public interface StoredObject extends ObjectStoreEntity, java.lang.Comparable<DirectoryOrObject>, ListSubject, DirectoryOrObject
uploadObject(java.io.File), uploadObject(java.io.File) and uploadObject(byte[]) which
all make sure you can upload your content to the Object Store. Downloading is done by calling
downloadObject(), downloadObject(java.io.File) and downloadObjectAsInputStream(). To
make sure the object really exists, you can call exists() which places a call to the Object Store. Deleting
is done by calling delete(). Creation is done implicitly by uploading content. Two other methods deserve
mention here. copyObject(Container, StoredObject) copies a StoredObject in a Container to another Container/
StoredObject combination. getPublicURL() gives you the public URL where the content can be viewed -- this
does not work on a private Container.| Modifier and Type | Method and Description |
|---|---|
void |
copyObject(Container targetContainer,
StoredObject targetObject)
Copies the content of an object to another object.
|
void |
delete()
Deletes an object in a container.
|
byte[] |
downloadObject()
Fetches the object in a Container in a byte array.
|
byte[] |
downloadObject(DownloadInstructions downloadInstructions)
See documentation of
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
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
downloadObjectAsInputStream(). |
boolean |
exists()
Checks whether a container exists
|
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.
|
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 |
getPath()
Returns the path to be appended to the host
|
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 seconds)
Returns a temporary GET URL to an Object.
|
java.lang.String |
getTempPutUrl(long seconds)
Returns a temporary POST URL to an Object, allowing one to directly upload content to the ObjectStore.
|
java.lang.String |
getURL()
This call checks the container privacy before deciding whether to use the configured / private
host or the default ObjectStore host.
|
boolean |
isInfoRetrieved()
Returns whether the metadata of the object has been retrieved
|
void |
reload()
Force the Account to reload its metadata
|
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.
|
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.
|
getMetadata, getMetadata, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setMetadatagetAsDirectory, getAsObject, getBareName, isDirectory, isObjectgetName, metadataSetFromHeadersjava.io.InputStream downloadObjectAsInputStream()
java.io.InputStream downloadObjectAsInputStream(DownloadInstructions downloadInstructions)
downloadObjectAsInputStream(). This method also accepts the download
instructions, which can be used among others to set the "Range" and "If-*" headers.downloadInstructions - the instructions for downloading the objectbyte[] downloadObject()
byte[] downloadObject(DownloadInstructions downloadInstructions)
downloadObject(). This method also accepts the download
instructions, which can be used among others to set the "Range" and "If-*" headers.downloadInstructions - the instructions for downloading the objectvoid downloadObject(java.io.File targetFile)
targetFile - the file to write the object tovoid downloadObject(java.io.File targetFile,
DownloadInstructions downloadInstructions)
downloadObject(java.io.File). This method also accepts the download
instructions, which can be used among others to set the "Range" and "If-*" headers.targetFile - the file to write the object todownloadInstructions - the instructions for downloading the objectvoid uploadObject(UploadInstructions uploadInstructions)
uploadInstructions - not only the content to be uploaded, but also additional headers that need to be setvoid uploadObject(java.io.InputStream inputStream)
inputStream - the actual content that must be uploaded to the object, in InputStream formatvoid uploadObject(byte[] fileToUpload)
fileToUpload - the actual content that must be uploaded to the objectvoid uploadObject(java.io.File fileToUpload)
fileToUpload - the file containing the content that must be uploaded to the objectvoid delete()
void copyObject(Container targetContainer, StoredObject targetObject)
targetContainer - the owning Container of the target location of the copytargetObject - the object location where the copy must be placedStoredObject setContentType(java.lang.String contentType)
contentType - the content type of the objectStoredObject setDeleteAfter(long seconds)
seconds - the number of seconds to wait before deleting the contentStoredObject setDeleteAfter(java.lang.Long seconds)
seconds - the number of seconds to wait before deleting the content. If seconds is null delete after header
will be clearedStoredObject setDeleteAt(java.util.Date date)
date - the date at which to delete the content. If date is null delete at header will be clearedjava.lang.String getURL()
java.lang.String getPublicURL()
java.lang.String getPrivateURL()
boolean exists()
boolean isInfoRetrieved()
void reload()
java.util.Date getLastModifiedAsDate()
java.lang.String getLastModified()
java.lang.String getEtag()
java.lang.String getManifest()
long getContentLength()
java.lang.String getContentType()
java.util.Date getDeleteAtAsDate()
java.lang.String getDeleteAt()
java.lang.String getTempGetUrl(long seconds)
seconds - number of seconds for the temporary URL to be validjava.lang.String getTempPutUrl(long seconds)
seconds - number of seconds for the temporary URL to be validboolean verifyTempUrl(java.lang.String method,
java.lang.String signature,
long expiry)
method - in REST terms, the command to executesignature - the password to use for creating the hashexpiry - the expiration time of the temporary URLjava.lang.String getPath()
ObjectStoreEntitygetPath in interface ObjectStoreEntityvoid setLastModified(java.util.Date date)
void setLastModified(java.lang.String date)
void setEtag(java.lang.String etag)
void setContentLength(long contentLength)
void setContentTypeWithoutSaving(java.lang.String contentType)
Copyright © 2012-2020 42 BV. All Rights Reserved.