if (this.options.getStoreFileContentMD5()) { this.md5Digest.update(data, offset, nextWrite);
if (this.options.getStoreFileContentMD5()) { this.md5Digest.update(data, offset, nextWrite);
/** * Commits the file. * * @throws StorageException * An exception representing any error which occurred during the operation. * @throws URISyntaxException */ @DoesServiceRequest private void commit() throws StorageException, URISyntaxException { if (this.options.getStoreFileContentMD5()) { this.parentFileRef.getProperties().setContentMD5(Base64.encode(this.md5Digest.digest())); } this.parentFileRef.uploadProperties(this.accessCondition, this.options, this.opContext); }
/** * Commits the file. * * @throws StorageException * An exception representing any error which occurred during the operation. * @throws URISyntaxException */ @DoesServiceRequest private void commit() throws StorageException, URISyntaxException { if (this.options.getStoreFileContentMD5()) { this.parentFileRef.getProperties().setContentMD5(Base64.encode(this.md5Digest.digest())); } this.parentFileRef.uploadProperties(this.accessCondition, this.options, this.opContext); }
if (this.options.getStoreFileContentMD5()) { try { this.md5Digest = MessageDigest.getInstance("MD5");
if (this.options.getStoreFileContentMD5()) { try { this.md5Digest = MessageDigest.getInstance("MD5");
/** * Creates an instance of the <code>FileRequestOptions</code> class by copying values from another * <code>FileRequestOptions</code> instance. * * @param other * A {@link FileRequestOptions} object which represents the file request options to copy. */ public FileRequestOptions(final FileRequestOptions other) { super(other); if (other != null) { this.setConcurrentRequestCount(other.getConcurrentRequestCount()); this.setDisableContentMD5Validation(other.getDisableContentMD5Validation()); this.setStoreFileContentMD5(other.getStoreFileContentMD5()); this.setUseTransactionalContentMD5(other.getUseTransactionalContentMD5()); } }
/** * Creates an instance of the <code>FileRequestOptions</code> class by copying values from another * <code>FileRequestOptions</code> instance. * * @param other * A {@link FileRequestOptions} object which represents the file request options to copy. */ public FileRequestOptions(final FileRequestOptions other) { super(other); if (other != null) { this.setConcurrentRequestCount(other.getConcurrentRequestCount()); this.setDisableContentMD5Validation(other.getDisableContentMD5Validation()); this.setStoreFileContentMD5(other.getStoreFileContentMD5()); this.setUseTransactionalContentMD5(other.getUseTransactionalContentMD5()); } }
/** * Applies defaults to the options passed in. * * @param modifiedOptions * The options to apply defaults to. */ protected static void applyDefaults(final FileRequestOptions modifiedOptions) { Utility.assertNotNull("modifiedOptions", modifiedOptions); RequestOptions.applyBaseDefaultsInternal(modifiedOptions); if (modifiedOptions.getConcurrentRequestCount() == null) { modifiedOptions.setConcurrentRequestCount(FileConstants.DEFAULT_CONCURRENT_REQUEST_COUNT); } if (modifiedOptions.getUseTransactionalContentMD5() == null) { modifiedOptions.setUseTransactionalContentMD5(false); } if (modifiedOptions.getStoreFileContentMD5() == null) { modifiedOptions.setStoreFileContentMD5(false); } if (modifiedOptions.getDisableContentMD5Validation() == null) { modifiedOptions.setDisableContentMD5Validation(false); } }
/** * Applies defaults to the options passed in. * * @param modifiedOptions * The options to apply defaults to. */ protected static void applyDefaults(final FileRequestOptions modifiedOptions) { Utility.assertNotNull("modifiedOptions", modifiedOptions); RequestOptions.applyBaseDefaultsInternal(modifiedOptions); if (modifiedOptions.getConcurrentRequestCount() == null) { modifiedOptions.setConcurrentRequestCount(FileConstants.DEFAULT_CONCURRENT_REQUEST_COUNT); } if (modifiedOptions.getUseTransactionalContentMD5() == null) { modifiedOptions.setUseTransactionalContentMD5(false); } if (modifiedOptions.getStoreFileContentMD5() == null) { modifiedOptions.setStoreFileContentMD5(false); } if (modifiedOptions.getDisableContentMD5Validation() == null) { modifiedOptions.setDisableContentMD5Validation(false); } }
if (options.getStoreFileContentMD5()) { throw new IllegalArgumentException(SR.FILE_MD5_NOT_POSSIBLE);
if (options.getStoreFileContentMD5()) { throw new IllegalArgumentException(SR.FILE_MD5_NOT_POSSIBLE);