/** * @return * the content disposition of this object, or null if it is unknown. */ public String getContentDisposition() { return (String) getMetadata(METADATA_HEADER_CONTENT_DISPOSITION); }
/** * @return * the content encoding of this object, or null if it is unknown. */ public String getContentEncoding() { return (String) getMetadata(METADATA_HEADER_CONTENT_ENCODING); }
/** * @return * the encryption algorithm used for server-side encryption (unencrypted if null). */ public String getServerSideEncryptionAlgorithm() { // First see if we have an explicit server-side encryption value, and return that if so... if (serverSideEncryptionAlgorithm != null) { return serverSideEncryptionAlgorithm; } // ...otherwise, look up server-side encryption setting in metadata return (String) getMetadata(METADATA_HEADER_SERVER_SIDE_ENCRYPTION); }
/** * @return * the hex-encoded MD5 hash of an object's data contents as stored in the JEtS3t-specific * metadata item <code>md5-hash</code>, or null if the hash value is not available. */ public String getMd5HashAsHex() { return (String) getMetadata(METADATA_HEADER_HASH_MD5); }
/** * @return * the content type of the object */ public String getContentType() { return (String) getMetadata(METADATA_HEADER_CONTENT_TYPE); }
/** * @return * the content encoding of this object, or null if it is unknown. */ public String getContentEncoding() { return (String) getMetadata(METADATA_HEADER_CONTENT_ENCODING); }
/** * @return * the hex-encoded MD5 hash of an object's data contents as stored in the JEtS3t-specific * metadata item <code>md5-hash</code>, or null if the hash value is not available. */ public String getMd5HashAsHex() { return (String) getMetadata(METADATA_HEADER_HASH_MD5); }
/** * @return * the content type of the object */ public String getContentType() { return (String) getMetadata(METADATA_HEADER_CONTENT_TYPE); }
/** * @return * the content language of this object, or null if it is unknown. */ public String getContentLanguage() { return (String) getMetadata(METADATA_HEADER_CONTENT_LANGUAGE); }
/** * @return * the content language of this object, or null if it is unknown. */ public String getContentLanguage() { return (String) getMetadata(METADATA_HEADER_CONTENT_LANGUAGE); }
/** * @return * the content disposition of this object, or null if it is unknown. */ public String getContentDisposition() { return (String) getMetadata(METADATA_HEADER_CONTENT_DISPOSITION); }
/** * @return * the encryption algorithm used for server-side encryption (unencrypted if null). */ public String getServerSideEncryptionAlgorithm() { // First see if we have an explicit server-side encryption value, and return that if so... if (serverSideEncryptionAlgorithm != null) { return serverSideEncryptionAlgorithm; } // ...otherwise, look up server-side encryption setting in metadata return (String) getMetadata(METADATA_HEADER_SERVER_SIDE_ENCRYPTION); }
/** * @return * the last modified date of this object, as provided by the service. If the last modified date is not * available (e.g. if the object has only just been created) the object's creation date is * returned instead. If both last modified and creation dates are unavailable, null is returned. */ public Date getLastModifiedDate() { Date lastModifiedDate = (Date) getMetadata(METADATA_HEADER_LAST_MODIFIED_DATE); if (lastModifiedDate == null) { // Perhaps this object has just been created, in which case we can use the Date metadata. lastModifiedDate = (Date) getMetadata(METADATA_HEADER_DATE); } return lastModifiedDate; }
/** * @return * the last modified date of this object, as provided by the service. If the last modified date is not * available (e.g. if the object has only just been created) the object's creation date is * returned instead. If both last modified and creation dates are unavailable, null is returned. */ public Date getLastModifiedDate() { Date lastModifiedDate = (Date) getMetadata(METADATA_HEADER_LAST_MODIFIED_DATE); if (lastModifiedDate == null) { // Perhaps this object has just been created, in which case we can use the Date metadata. lastModifiedDate = (Date) getMetadata(METADATA_HEADER_DATE); } return lastModifiedDate; }
/** * @return * the content length, or size, of this object's data, or 0 if it is unknown. */ public long getContentLength() { Object contentLength = getMetadata(METADATA_HEADER_CONTENT_LENGTH); if (contentLength == null) { return 0; } else { return Long.parseLong(contentLength.toString()); } }
/** * @return * the content length, or size, of this object's data, or 0 if it is unknown. */ public long getContentLength() { Object contentLength = getMetadata(METADATA_HEADER_CONTENT_LENGTH); if (contentLength == null) { return 0; } else { return Long.parseLong(contentLength.toString()); } }
/** * @return * the ETag value of the object as returned by the service when an object is created. The ETag * value does not include quote (") characters. This value will be null if the object's ETag value * is not known, such as when an object has not yet been uploaded to the service. */ public String getETag() { String etag = (String) getMetadata(METADATA_HEADER_ETAG); if (etag != null) { if (etag.startsWith("\"") && etag.endsWith("\"")) { return etag.substring(1, etag.length() -1); } } return etag; }
/** * @return * the ETag value of the object as returned by the service when an object is created. The ETag * value does not include quote (") characters. This value will be null if the object's ETag value * is not known, such as when an object has not yet been uploaded to the service. */ public String getETag() { String etag = (String) getMetadata(METADATA_HEADER_ETAG); if (etag != null) { if (etag.startsWith("\"") && etag.endsWith("\"")) { return etag.substring(1, etag.length() -1); } } return etag; }
protected boolean isLiveMD5HashingRequired(StorageObject object) { // We do not need to calculate the data MD5 hash during upload if the // expected hash value was provided as the object's Content-MD5 header. if(object.getMetadata(StorageObject.METADATA_HEADER_CONTENT_MD5) != null) { return false; } boolean disableLiveMd5 = getJetS3tProperties().getBoolProperty( "storage-service.disable-live-md5", false); return !disableLiveMd5; }
protected boolean isLiveMD5HashingRequired(StorageObject object) { // We do not need to calculate the data MD5 hash during upload if the // expected hash value was provided as the object's Content-MD5 header. if(object.getMetadata(StorageObject.METADATA_HEADER_CONTENT_MD5) != null) { return false; } boolean disableLiveMd5 = getJetS3tProperties().getBoolProperty( "storage-service.disable-live-md5", false); return !disableLiveMd5; }