public class FileSystemStorageProvider extends Object implements StorageProvider
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONTENT_REPOSITORY |
static String |
DEFAULT_CONTENT_STORE |
static String |
DEFAULT_TMP |
static String |
KARAF_HOME |
static String |
REF_EXT |
Constructor and Description |
---|
FileSystemStorageProvider()
Default constructor, invoked by blueprint.
|
Modifier and Type | Method and Description |
---|---|
void |
commit(StorageRequest request)
Commit will be called by the
CatalogFramework to finalize create, update,
and delete requests. |
CreateStorageResponse |
create(CreateStorageRequest createRequest)
Creates an item in the content repository.
|
DeleteStorageResponse |
delete(DeleteStorageRequest deleteRequest)
Deletes a
ContentItem from the content repository. |
MimeTypeMapper |
getMimeTypeMapper() |
ReadStorageResponse |
read(ReadStorageRequest readRequest)
Retrieves a
ContentItem from the content repository. |
void |
rollback(StorageRequest request)
Rollback will be called by the
CatalogFramework to discard changes related
to create, update, and delete requests |
void |
setBaseContentDirectory(String baseDirectory) |
void |
setMimeTypeMapper(MimeTypeMapper mimeTypeMapper) |
UpdateStorageResponse |
update(UpdateStorageRequest updateRequest)
Updates a
ContentItem in the content repository. |
public static final String DEFAULT_CONTENT_REPOSITORY
public static final String DEFAULT_CONTENT_STORE
public static final String DEFAULT_TMP
public static final String KARAF_HOME
public static final String REF_EXT
public FileSystemStorageProvider()
public CreateStorageResponse create(CreateStorageRequest createRequest) throws StorageException
StorageProvider
create
in interface StorageProvider
createRequest
- the CreateStorageRequest
that contains the ContentItem
to be stored/created in the content repository. The
ID of the ContentItem
will be auto-generated by the
StorageProvider.CreateStorageResponse
that contains the ContentItem
created by the StorageProvider in the content
repository. This ContentItem
will contain the GUID
assigned by the StorageProvider. This GUID will be used in subsequent UpdateStorageRequest
, ReadStorageRequest
, and DeleteStorageRequest
to
access the stored ContentItem
.StorageException
- if any problems encountered while creating/storing the ContentItem
public ReadStorageResponse read(ReadStorageRequest readRequest) throws StorageException
StorageProvider
ContentItem
from the content repository.read
in interface StorageProvider
readRequest
- the ReadStorageRequest
that contains the GUID of the ContentItem
to be retrievedReadStorageResponse
that contains the ContentItem
retrieved by the StorageProvider from the content
repository.StorageException
- if any problems encountered while retrieving the ContentItem
public UpdateStorageResponse update(UpdateStorageRequest updateRequest) throws StorageException
StorageProvider
ContentItem
in the content repository. The ContentItem
must already exist in the content repository in order to
be updated. The StorageProvider will not automatically create the ContentItem
if it does not exist.update
in interface StorageProvider
updateRequest
- the UpdateStorageRequest
that contains the GUID of the
ContentItem
to be updated and the InputStream
with the new data to overwrite the existing ContentItem
in the content repository.UpdateStorageResponse
that contains the ContentItem
updated by the StorageProvider in the content
repository.StorageException
- if any problems encountered while updating the ContentItem
public DeleteStorageResponse delete(DeleteStorageRequest deleteRequest) throws StorageException
StorageProvider
ContentItem
from the content repository.delete
in interface StorageProvider
deleteRequest
- the DeleteStorageRequest
that contains the GUID of the ContentItem
to be deleted.DeleteStorageResponse
that contains the status of the deletion of the
ContentItem
from the content repository.StorageException
- if any problems encountered while deleting the ContentItem
public void commit(StorageRequest request) throws StorageException
StorageProvider
CatalogFramework
to finalize create, update,
and delete requests.commit
in interface StorageProvider
request
- the id associated with the requestStorageException
public void rollback(StorageRequest request) throws StorageException
StorageProvider
CatalogFramework
to discard changes related
to create, update, and delete requestsrollback
in interface StorageProvider
request
- the id associated with the requestStorageException
public MimeTypeMapper getMimeTypeMapper()
public void setMimeTypeMapper(MimeTypeMapper mimeTypeMapper)
public void setBaseContentDirectory(String baseDirectory) throws IOException
IOException
This work is licensed under a Creative Commons Attribution 4.0 International License.