use of com.owncloud.android.lib.resources.e2ee.StoreMetadataRemoteOperation in project android by nextcloud.
the class EncryptionUtils method uploadMetadata.
public static void uploadMetadata(OCFile parentFile, String serializedFolderMetadata, String token, OwnCloudClient client, boolean metadataExists) throws UploadException {
RemoteOperationResult uploadMetadataOperationResult;
if (metadataExists) {
// update metadata
UpdateMetadataRemoteOperation storeMetadataOperation = new UpdateMetadataRemoteOperation(parentFile.getLocalId(), serializedFolderMetadata, token);
uploadMetadataOperationResult = storeMetadataOperation.execute(client);
} else {
// store metadata
StoreMetadataRemoteOperation storeMetadataOperation = new StoreMetadataRemoteOperation(parentFile.getLocalId(), serializedFolderMetadata);
uploadMetadataOperationResult = storeMetadataOperation.execute(client);
}
if (!uploadMetadataOperationResult.isSuccess()) {
throw new UploadException("Storing/updating metadata was not successful");
}
}
Aggregations