public class FSStorageEngine extends Object implements PhysicalStorageEngine
PhysicalStorageEngine
which operates on the local file system.Constructor and Description |
---|
FSStorageEngine() |
Modifier and Type | Method and Description |
---|---|
String |
createURL(DownloadBuilder downloadBuilder)
Can provide a custom download URL for a given builder.
|
void |
deletePhysicalObject(String bucket,
String physicalKey)
Deletes the physical object in the given bucket with the given id
|
void |
deliver(sirius.web.http.WebContext ctx,
String bucket,
String physicalKey,
String fileExtension)
Delivers the requested object to the given request as response.
|
InputStream |
getData(String bucket,
String physicalKey)
Downloads an provides the contents of the requested object.
|
void |
storePhysicalObject(String bucket,
String physicalKey,
InputStream data,
String md5,
long size)
Stores the given data for the given key in the given bucket.
|
public void storePhysicalObject(String bucket, String physicalKey, InputStream data, String md5, long size) throws IOException
PhysicalStorageEngine
storePhysicalObject
in interface PhysicalStorageEngine
bucket
- the bucket to store the object inphysicalKey
- the physical storage key (a key is always only used once)data
- the data to storemd5
- the MD5 checksum of the datasize
- the byte length of the dataIOException
- in case of an IO errorpublic void deletePhysicalObject(String bucket, String physicalKey)
PhysicalStorageEngine
deletePhysicalObject
in interface PhysicalStorageEngine
bucket
- the bucket to delete the object fromphysicalKey
- the id of the object to delete@Nullable public InputStream getData(String bucket, String physicalKey)
PhysicalStorageEngine
getData
in interface PhysicalStorageEngine
bucket
- the bucket of the objectphysicalKey
- the id of the objectpublic void deliver(sirius.web.http.WebContext ctx, String bucket, String physicalKey, String fileExtension)
PhysicalStorageEngine
deliver
in interface PhysicalStorageEngine
ctx
- the request to provide a response forbucket
- the bucket of the object to deliverphysicalKey
- the id of the object to deliverfileExtension
- the file extension e.g. to setup a matching Content-Typepublic String createURL(DownloadBuilder downloadBuilder)
PhysicalStorageEngine
createURL
in interface PhysicalStorageEngine
downloadBuilder
- the builder specifying the download parametersCopyright © 2018. All rights reserved.