public abstract class AbstractStoredObject extends AbstractObjectStoreEntity<ObjectInformation> implements StoredObject
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
name |
ALLOW_CACHING, info, staleHeaders| Constructor and Description |
|---|
AbstractStoredObject(Container container,
java.lang.String name,
boolean allowCaching) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DirectoryOrObject o) |
void |
copyObject(Container targetContainer,
StoredObject targetObject)
Copies the content of an object to another object.
|
protected Metadata |
createMetadataEntry(java.lang.String name,
java.lang.String value) |
void |
delete()
Deletes an object in a container.
|
void |
directlyUploadObject(UploadInstructions uploadInstructions) |
byte[] |
downloadObject()
Fetches the object in a Container in a byte array.
|
byte[] |
downloadObject(DownloadInstructions downloadInstructions)
See documentation of
StoredObject.downloadObject(). |
void |
downloadObject(java.io.File targetFile)
Reads the object and writes it to a file.
|
void |
downloadObject(java.io.File targetFile,
DownloadInstructions downloadInstructions)
See documentation of
StoredObject.downloadObject(java.io.File). |
java.io.InputStream |
downloadObjectAsInputStream()
Fetches the object in a Container in an InputStream.
|
java.io.InputStream |
downloadObjectAsInputStream(DownloadInstructions downloadInstructions)
See documentation of
StoredObject.downloadObjectAsInputStream(). |
boolean |
equals(java.lang.Object o) |
protected Account |
getAccount() |
Directory |
getAsDirectory() |
StoredObject |
getAsObject() |
java.lang.String |
getBareName() |
Container |
getContainer() |
long |
getContentLength()
The number of the bytes used by the StoredObject.
|
java.lang.String |
getContentType()
The content type of the StoredObject.
|
java.lang.String |
getDeleteAt()
The date when the object will be deleted.
|
java.util.Date |
getDeleteAtAsDate()
The date when the object will be deleted.
|
java.lang.String |
getEtag()
The etag (or hash) of the StoredObject.
|
protected void |
getInfo(boolean allowErrorLog) |
java.lang.String |
getLastModified()
The last modified date of the StoredObject.
|
java.util.Date |
getLastModifiedAsDate()
The last modified date of the StoredObject.
|
java.lang.String |
getManifest()
The manifest of the StoredObject (relevant for large objects that are segmented).
|
java.lang.String |
getName() |
java.lang.String |
getPathForEntity() |
java.lang.String |
getPrivateURL()
Returns the private URL through which the resource can be viewed
|
java.lang.String |
getPublicURL()
Returns the URL through which the resource can be viewed
|
java.lang.String |
getTempGetUrl(long durationInSeconds)
Returns a temporary GET URL to an Object.
|
java.lang.String |
getTempPutUrl(long durationInSeconds)
Returns a temporary POST URL to an Object, allowing one to directly upload content to the ObjectStore.
|
protected java.lang.String |
getTempUrl(java.lang.String method,
long durationInSeconds) |
java.lang.String |
getURL()
This call checks the container privacy before deciding whether to use the configured / private
host or the default ObjectStore host.
|
int |
hashCode() |
boolean |
isDirectory() |
boolean |
isObject() |
void |
metadataSetFromHeaders()
Declares to the ListSubject that a number of fields have been read from the list operation
and therefore do not have to be fetched individually, unless caching is turned off.
|
protected void |
saveSpecificMetadata() |
void |
setContentLength(long contentLength) |
StoredObject |
setContentType(java.lang.String contentType)
Explicitly sets the content type of an object.
|
void |
setContentTypeWithoutSaving(java.lang.String contentType) |
StoredObject |
setDeleteAfter(long seconds)
Schedules the object to be deleted after a fixed period of x seconds
|
StoredObject |
setDeleteAfter(java.lang.Long seconds)
Schedules the object to be deleted after a fixed period of x seconds
|
StoredObject |
setDeleteAt(java.util.Date date)
Schedules the object to be deleted at a fixed date.
|
void |
setEtag(java.lang.String etag) |
void |
setLastModified(java.util.Date date) |
void |
setLastModified(java.lang.String date) |
void |
uploadObject(byte[] fileToUpload)
Uploads a byte array object to a location designated by the Container and the object.
|
void |
uploadObject(java.io.File fileToUpload)
Uploads a file from a designated location to a location designated by the Container and the
object.
|
void |
uploadObject(java.io.InputStream inputStream)
Uploads a byte array object to a location designated by the Container and the object.
|
void |
uploadObject(UploadInstructions uploadInstructions)
Uploads a byte array object to a location designated by the Container and the object.
|
void |
uploadObjectAsSegments(UploadInstructions uploadInstructions) |
boolean |
verifyTempUrl(java.lang.String method,
java.lang.String signature,
long expiry)
Creates a hash using the server's hash password and compares it to the signature.
|
checkForInfo, checkForInfo, checkForInfoAndAllowHeaderSet, checkForInfoDisallowErrorLog, exists, getMetadata, getMetadata, getPath, invalidate, isAllowCaching, isInfoRetrieved, isStale, reload, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setInfoRetrieved, setMetadataclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitexists, getPath, isInfoRetrieved, reloadgetMetadata, getMetadata, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setMetadatapublic AbstractStoredObject(Container container, java.lang.String name, boolean allowCaching)
public void metadataSetFromHeaders()
ListSubjectmetadataSetFromHeaders in interface ListSubjectpublic java.util.Date getLastModifiedAsDate()
StoredObjectgetLastModifiedAsDate in interface StoredObjectpublic java.lang.String getLastModified()
StoredObjectgetLastModified in interface StoredObjectpublic java.lang.String getEtag()
StoredObjectgetEtag in interface StoredObjectpublic java.lang.String getManifest()
StoredObjectgetManifest in interface StoredObjectpublic long getContentLength()
StoredObjectgetContentLength in interface StoredObjectpublic java.lang.String getContentType()
StoredObjectgetContentType in interface StoredObjectpublic java.util.Date getDeleteAtAsDate()
StoredObjectgetDeleteAtAsDate in interface StoredObjectpublic java.lang.String getDeleteAt()
StoredObjectgetDeleteAt in interface StoredObjectpublic java.lang.String getName()
getName in interface ListSubjectpublic Container getContainer()
public java.lang.String getURL()
StoredObjectgetURL in interface StoredObjectpublic java.lang.String getPublicURL()
StoredObjectgetPublicURL in interface StoredObjectpublic java.lang.String getPrivateURL()
StoredObjectgetPrivateURL in interface StoredObjectpublic java.lang.String getPathForEntity()
throws java.io.UnsupportedEncodingException
getPathForEntity in class AbstractObjectStoreEntity<ObjectInformation>java.io.UnsupportedEncodingExceptionpublic void setLastModified(java.util.Date date)
setLastModified in interface StoredObjectpublic void setLastModified(java.lang.String date)
setLastModified in interface StoredObjectpublic void setEtag(java.lang.String etag)
setEtag in interface StoredObjectpublic void setContentLength(long contentLength)
setContentLength in interface StoredObjectpublic void setContentTypeWithoutSaving(java.lang.String contentType)
setContentTypeWithoutSaving in interface StoredObjectpublic int hashCode()
hashCode in class java.lang.Objectpublic void uploadObject(UploadInstructions uploadInstructions)
StoredObjectuploadObject in interface StoredObjectuploadInstructions - not only the content to be uploaded, but also additional headers that need to be setpublic void uploadObjectAsSegments(UploadInstructions uploadInstructions)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(DirectoryOrObject o)
compareTo in interface java.lang.Comparable<DirectoryOrObject>protected Metadata createMetadataEntry(java.lang.String name, java.lang.String value)
createMetadataEntry in class AbstractObjectStoreEntity<ObjectInformation>public java.io.InputStream downloadObjectAsInputStream()
StoredObjectdownloadObjectAsInputStream in interface StoredObjectpublic java.io.InputStream downloadObjectAsInputStream(DownloadInstructions downloadInstructions)
StoredObjectStoredObject.downloadObjectAsInputStream(). This method also accepts the download
instructions, which can be used among others to set the "Range" and "If-*" headers.downloadObjectAsInputStream in interface StoredObjectdownloadInstructions - the instructions for downloading the objectpublic byte[] downloadObject()
StoredObjectdownloadObject in interface StoredObjectpublic byte[] downloadObject(DownloadInstructions downloadInstructions)
StoredObjectStoredObject.downloadObject(). This method also accepts the download
instructions, which can be used among others to set the "Range" and "If-*" headers.downloadObject in interface StoredObjectdownloadInstructions - the instructions for downloading the objectpublic void downloadObject(java.io.File targetFile)
StoredObjectdownloadObject in interface StoredObjecttargetFile - the file to write the object topublic void downloadObject(java.io.File targetFile,
DownloadInstructions downloadInstructions)
StoredObjectStoredObject.downloadObject(java.io.File). This method also accepts the download
instructions, which can be used among others to set the "Range" and "If-*" headers.downloadObject in interface StoredObjecttargetFile - the file to write the object todownloadInstructions - the instructions for downloading the objectpublic void directlyUploadObject(UploadInstructions uploadInstructions)
public void uploadObject(java.io.InputStream inputStream)
StoredObjectuploadObject in interface StoredObjectinputStream - the actual content that must be uploaded to the object, in InputStream formatpublic void uploadObject(byte[] fileToUpload)
StoredObjectuploadObject in interface StoredObjectfileToUpload - the actual content that must be uploaded to the objectpublic void uploadObject(java.io.File fileToUpload)
StoredObjectuploadObject in interface StoredObjectfileToUpload - the file containing the content that must be uploaded to the objectpublic void delete()
StoredObjectdelete in interface StoredObjectpublic void copyObject(Container targetContainer, StoredObject targetObject)
StoredObjectcopyObject in interface StoredObjecttargetContainer - the owning Container of the target location of the copytargetObject - the object location where the copy must be placedpublic StoredObject setContentType(java.lang.String contentType)
StoredObjectsetContentType in interface StoredObjectcontentType - the content type of the objectpublic StoredObject setDeleteAfter(java.lang.Long seconds)
StoredObjectsetDeleteAfter in interface StoredObjectseconds - the number of seconds to wait before deleting the content. If seconds is null delete after header
will be clearedpublic StoredObject setDeleteAfter(long seconds)
StoredObjectsetDeleteAfter in interface StoredObjectseconds - the number of seconds to wait before deleting the contentpublic StoredObject setDeleteAt(java.util.Date date)
StoredObjectsetDeleteAt in interface StoredObjectdate - the date at which to delete the content. If date is null delete at header will be clearedprotected Account getAccount()
protected void saveSpecificMetadata()
saveSpecificMetadata in class AbstractObjectStoreEntity<ObjectInformation>protected void getInfo(boolean allowErrorLog)
getInfo in class AbstractObjectStoreEntity<ObjectInformation>public java.lang.String getTempGetUrl(long durationInSeconds)
StoredObjectgetTempGetUrl in interface StoredObjectdurationInSeconds - number of seconds for the temporary URL to be validpublic java.lang.String getTempPutUrl(long durationInSeconds)
StoredObjectgetTempPutUrl in interface StoredObjectdurationInSeconds - number of seconds for the temporary URL to be validprotected java.lang.String getTempUrl(java.lang.String method,
long durationInSeconds)
public boolean verifyTempUrl(java.lang.String method,
java.lang.String signature,
long expiry)
StoredObjectverifyTempUrl in interface StoredObjectmethod - in REST terms, the command to executesignature - the password to use for creating the hashexpiry - the expiration time of the temporary URLpublic boolean isObject()
isObject in interface DirectoryOrObjectpublic boolean isDirectory()
isDirectory in interface DirectoryOrObjectpublic Directory getAsDirectory()
getAsDirectory in interface DirectoryOrObjectpublic StoredObject getAsObject()
getAsObject in interface DirectoryOrObjectpublic java.lang.String getBareName()
getBareName in interface DirectoryOrObjectCopyright © 2012-2020 42 BV. All Rights Reserved.