public class FileSystemBLOBStore extends Object implements ResourceBasedBLOBStore
FileSystemBLOBStore
is a ResourceBasedBLOBStore
implementation that stores BLOB data in a FileSystem
.
Note that The DataStore should nowadays be used instead of the BLOBStore.
Constructor and Description |
---|
FileSystemBLOBStore(FileSystem fs)
Creates a new
FileSystemBLOBStore instance. |
Modifier and Type | Method and Description |
---|---|
String |
createId(PropertyId id,
int index)
Creates a unique identifier for the BLOB data associated with the given
property id and value subscript.
|
InputStream |
get(String blobId)
Retrieves the BLOB data with the specified id as a binary stream.
|
FileSystemResource |
getResource(String blobId)
Retrieves the BLOB data with the specified id as a permanent resource.
|
void |
put(String blobId,
InputStream in,
long size)
Stores the BLOB data and returns a unique identifier.
|
boolean |
remove(String blobId)
Removes the BLOB data with the specified id.
|
public FileSystemBLOBStore(FileSystem fs)
FileSystemBLOBStore
instance.fs
- file system for storing the BLOB datapublic String createId(PropertyId id, int index)
public InputStream get(String blobId) throws Exception
get
in interface BLOBStore
blobId
- identifier of the BLOB data as returned by
BLOBStore.createId(PropertyId, int)
Exception
- if an error occuredpublic void put(String blobId, InputStream in, long size) throws Exception
put
in interface BLOBStore
blobId
- identifier of the BLOB data as returned by
BLOBStore.createId(PropertyId, int)
in
- stream containing the BLOB datasize
- size of the BLOB dataException
- if an error occuredpublic boolean remove(String blobId) throws Exception
remove
in interface BLOBStore
blobId
- identifier of the BLOB data as returned by
BLOBStore.createId(PropertyId, int)
true
if BLOB data with the given id exists and has
been successfully removed, false
if there's no BLOB
data with the given id.Exception
- if an error occuredpublic FileSystemResource getResource(String blobId) throws Exception
getResource
in interface ResourceBasedBLOBStore
blobId
- identifier of the BLOB data as returned by
BLOBStore.createId(org.apache.jackrabbit.core.id.PropertyId , int)
Exception
- if an error occurredCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.