|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.baselayer.filesystemImpl.LocalFilesystemStorage
public class LocalFilesystemStorage
Manager for fies stored on local file system. Access can and should get restricted to particular directory trees, otherwise it is able to read all configuration files of the user under whichs permissions the manager is running.
Field Summary |
---|
Fields inherited from interface org.gcube.contentmanagement.baselayer.InstantiableManager |
---|
MANAGER_INSTANTIATION_METHOD_NAME |
Method Summary | |
---|---|
boolean |
deleteBinaryContent(RawContentLocation rcl,
BasicStorageHints hints)
Removes the binary content from storage |
boolean |
existsBinaryContent(RawContentLocation rcl,
BasicStorageHints hints)
Checks whether there is content at this location |
BaseLayerStream |
getBinaryContent(java.io.File file,
BasicStorageHints hints)
Opens the content for reading and passes the input stream to the caller |
BaseLayerStream |
getBinaryContent(RawContentLocation rcl,
BasicStorageHints hints)
Opens the content for reading and passes the input stream to the caller |
java.lang.String |
getDataProvider()
|
static java.lang.String |
getDataProviderPrefix()
Returns the prefix that is used by the manager for identying responsibility for a data source |
static LocalFilesystemStorage |
getInstance()
|
static LocalFilesystemStorage |
getManagerFor(RawContentLocation rcl)
Factory method that returns the instance of a manager for a particular location. |
static LocalFilesystemStorage |
getManagerFor(java.lang.String directory)
Deprecated. use getManagerInstance() instead; |
static LocalFilesystemStorage |
getManagerInstance(java.lang.String[] params,
java.lang.String managerName)
Generic factory method that returns an instance responsible for a particular directory |
java.lang.String |
getUniqueStorageLocationIDFor(java.lang.String objectID)
|
boolean |
handles(java.lang.String dataProvider)
Checks whether the RawFileContentManager can handle this data. |
RawContentLocation |
makePermanentLocation(RawContentLocation currentLocation,
BasicStorageHints hints)
Returns a raw location, which can be stored and retrieved later without the need to pass again all the hints. |
RawContentLocation |
saveBinaryContent(java.io.File outputFile,
BaseLayerStream binaryFileContent,
BasicStorageHints hints)
Saves the passed binary content in the managed resource. |
RawContentLocation |
saveBinaryContent(java.lang.String uniqueStorageID,
BaseLayerStream binaryFileContent,
BasicStorageHints hints)
Saves the passed binary content in the managed resource. |
boolean |
supportsAppending()
Tells whether this content manager supports appending content in addition to overwriting the content when storing |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static LocalFilesystemStorage getInstance()
public static LocalFilesystemStorage getManagerInstance(java.lang.String[] params, java.lang.String managerName) throws BaseLayerException
params
- the first String contains the directory that will be managed.
If array is empty, the manager will be able to manage any
directorymanagerName
- the name of the manager (currently not in use)
BaseLayerException
- if location is not manageable by this kind of manager, e.g.
because directory does not existpublic java.lang.String getDataProvider()
getDataProvider
in interface RawFileContentManager
public static java.lang.String getDataProviderPrefix()
public static LocalFilesystemStorage getManagerFor(java.lang.String directory) throws BaseLayerException
directory
- the directory to manage
BaseLayerException
- if location is not manageable by this kind of manager, e.g.
because directory does not existpublic static LocalFilesystemStorage getManagerFor(RawContentLocation rcl) throws BaseLayerException
rcl
- the raw content location under responsibility of the manager
BaseLayerException
- if location is not manageable by this kind of manager, e.g.
because directory does not existpublic boolean supportsAppending()
supportsAppending
in interface RawFileContentManager
BasicStorageHints#HINT_NAME_APPEND_CONTENT
public boolean handles(java.lang.String dataProvider)
This means that it can handle the requests for content stored at this dataprovider. In the ideal case, this also checks if it has all required access rights. But this cannot be enforced as a strong requirement before the actual calls take place.
handles
in interface RawFileContentManager
dataprovider
-
public RawContentLocation saveBinaryContent(java.lang.String uniqueStorageID, BaseLayerStream binaryFileContent, BasicStorageHints hints) throws BaseLayerException
saveBinaryContent
in interface RawFileContentManager
binaryFileContent
- the content to storeuniqueStorageID
- a unique ID to access the contenthints
- the hints that should be used
java.io.IOException
- in case of failure of underlying storage system
BaseLayerException
- in case of failure of underlying storage systempublic java.lang.String getUniqueStorageLocationIDFor(java.lang.String objectID)
getUniqueStorageLocationIDFor
in interface RawFileContentManager
public RawContentLocation saveBinaryContent(java.io.File outputFile, BaseLayerStream binaryFileContent, BasicStorageHints hints) throws BaseLayerException
binaryFileContent
- the content to storeoutputFile
- a local file to store the content
java.io.IOException
- in case of failure of underlying storage system
BaseLayerException
public BaseLayerStream getBinaryContent(RawContentLocation rcl, BasicStorageHints hints) throws BaseLayerException
getBinaryContent
in interface RawFileContentManager
rcl
- the RawContentLocation where the content is accessiblehints
- the hints that should be used
BaseLayerException
- in case of failure of underlying storage systempublic BaseLayerStream getBinaryContent(java.io.File file, BasicStorageHints hints) throws ObjectNotFoundException, ValueNotValidException, BaseLayerException
file
- the file that should be readhints
- the hints that should be used
ObjectNotFoundException
- if file does not exist
ValueNotValidException
- if some value, e.g. a hint has an invalid value
BaseLayerException
- in case of failure of underlying storage systempublic boolean deleteBinaryContent(RawContentLocation rcl, BasicStorageHints hints) throws BaseLayerException
deleteBinaryContent
in interface RawFileContentManager
rcl
- the RawContentLocation where the content is accessiblehints
- the hints that should be used
BaseLayerException
- in case of failure of underlying storage systempublic boolean existsBinaryContent(RawContentLocation rcl, BasicStorageHints hints) throws ValueNotValidException
existsBinaryContent
in interface RawFileContentManager
rcl
- the RawContentLocation where the content is accessible
ValueNotValidException
public RawContentLocation makePermanentLocation(RawContentLocation currentLocation, BasicStorageHints hints) throws ValueNotValidException
This is of particular interest for username / password combinations.
makePermanentLocation
in interface RawFileContentManager
currentLocation
- the location, where content can be accessed currently (may
require information from the hints)hints
- hints, that may be needed to request the content
ValueNotValidException
- If some hints was not defined correctly or there is no
possibility to include that in the permanent location.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |