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
StorageProvidercreate in interface StorageProvidercreateRequest - 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 ContentItempublic ReadStorageResponse read(ReadStorageRequest readRequest) throws StorageException
StorageProviderContentItem from the content repository.read in interface StorageProviderreadRequest - 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 ContentItempublic UpdateStorageResponse update(UpdateStorageRequest updateRequest) throws StorageException
StorageProviderContentItem 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 StorageProviderupdateRequest - 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 ContentItempublic DeleteStorageResponse delete(DeleteStorageRequest deleteRequest) throws StorageException
StorageProviderContentItem from the content repository.delete in interface StorageProviderdeleteRequest - 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 ContentItempublic void commit(StorageRequest request) throws StorageException
StorageProviderCatalogFramework to finalize create, update,
and delete requests.commit in interface StorageProviderrequest - the id associated with the requestStorageExceptionpublic void rollback(StorageRequest request) throws StorageException
StorageProviderCatalogFramework to discard changes related
to create, update, and delete requestsrollback in interface StorageProviderrequest - the id associated with the requestStorageExceptionpublic MimeTypeMapper getMimeTypeMapper()
public void setMimeTypeMapper(MimeTypeMapper mimeTypeMapper)
public void setBaseContentDirectory(String baseDirectory) throws IOException
IOExceptionThis work is licensed under a Creative Commons Attribution 4.0 International License.