I am writing an application that monitor the file events for the team; we have a team namespace and I am using the Refresh Team Token for the API in Java. The information I get from the event in the Event Log for a file event is not enough for my use. It does not have the File Hash Content, file size most of the time is null, and other information which the FileMetaData has. So from the DbxTeamClient, I switch to the Team Member and then I tried to get the DbxUserFilesRequests so I can get the MetaData. It works for the private files, but it fails if the file is shared. I tried all the member ID and it always fails it the file is shared. Can anybody know how to get the Metadata for a shared file. I will show the code where the API call is failed.
static Metadata getFileMetaDataFromFilePath(String teamMemberId, String path) throws DbxException {
DbxClientV2 dbxClient = dbxTeamClient.asMember(teamMemberId);
DbxUserFilesRequests dbxUserFilesRequests = dbxClient.files();
Metadata metadata = dbxUserFilesRequests.getMetadata(path);//It fails right here if the file is shared file.
System.out.println(metadata.toStringMultiline());
return metadata;
}These are the error messages :
Exception in thread "main" com.dropbox.core.v2.files.GetMetadataErrorException: Exception in 2/files/get_metadata: {".tag":"path","path":"not_found"}
at com.dropbox.core.v2.files.DbxUserFilesRequests.getMetadata(DbxUserFilesRequests.java:1563)
at com.dropbox.core.v2.files.DbxUserFilesRequests.getMetadata(DbxUserFilesRequests.java:1586)
at tri.test.features.file.info.FileMetaData.getFileMetaDataFromFilePath(FileMetaData.java:437)
at tri.test.features.file.info.FileMetaData.main(FileMetaData.java:468)