|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.baselayer.networkFileTransfer.GridFTPContentManager
public class GridFTPContentManager
This class provides easy-to-use access to GridFTP The implementation is backed by the Commodity Grid (CoG) Kit, that provides some assistance to bridge between gt2 and gt4 and is part of the GT4 WS-Core distribution.
Field Summary |
---|
Fields inherited from interface org.gcube.contentmanagement.baselayer.InstantiableManager |
---|
MANAGER_INSTANTIATION_METHOD_NAME |
Constructor Summary | |
---|---|
GridFTPContentManager(java.lang.String managedURL)
Constructs a new manager for a particular URL |
Method Summary | |
---|---|
boolean |
deleteBinaryContent(RawContentLocation location,
BasicStorageHints hints)
Removes the binary content from storage |
void |
ensureResponsibleFor(RawContentLocation rcl)
|
boolean |
existsBinaryContent(RawContentLocation location,
BasicStorageHints hints)
Checks whether there is content associated with this ID |
void |
get(java.lang.String remotePath,
java.io.File localFile)
Downloads a file from a remote GridFTP server and stores it in a local file |
BaseLayerStream |
getBinaryContent(RawContentLocation location,
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 GridFTPContentManager |
getManagerInstance(java.lang.String[] params,
java.lang.String managerName)
Generic factory method that returns an instance responsible for a particular URL |
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. |
void |
put(java.io.File localFile,
java.lang.String remotePath)
Uploads a local file to a remote GridFTP server |
RawContentLocation |
saveBinaryContent(java.lang.String uniqueStorageID,
BaseLayerStream binaryFileContent,
BasicStorageHints hints)
Saves the passed binary content in the managed resource. |
void |
setCredentialsProvider(CredentialsProvider provider)
|
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 |
Constructor Detail |
---|
public GridFTPContentManager(java.lang.String managedURL)
managedURL
- the URL that should be mamagedMethod Detail |
---|
public static java.lang.String getDataProviderPrefix()
public void put(java.io.File localFile, java.lang.String remotePath) throws BaseLayerException
localFile
- path to the local fileremotePath
- URL of remote server
BaseLayerException
- in any case of failurepublic void get(java.lang.String remotePath, java.io.File localFile) throws BaseLayerException
remotePath
- URL of file on remote serverlocalFile
- path to the local file
BaseLayerException
- in any case of failurepublic RawContentLocation saveBinaryContent(java.lang.String uniqueStorageID, BaseLayerStream binaryFileContent, BasicStorageHints hints) throws BaseLayerException
saveBinaryContent
in interface RawFileContentManager
uniqueStorageID
- a unique ID to as a hint where to store the contentbinaryFileContent
- the content to storehints
- the hints that should be used
BaseLayerException
- in case of failure of underlying storage systempublic BaseLayerStream getBinaryContent(RawContentLocation location, BasicStorageHints hints) throws BaseLayerException
getBinaryContent
in interface RawFileContentManager
location
- the location to access the contenthints
- the hints that should be used
BaseLayerException
- in case of failure of underlying storage systempublic boolean deleteBinaryContent(RawContentLocation location, BasicStorageHints hints) throws BaseLayerException
deleteBinaryContent
in interface RawFileContentManager
location
- the location of the content that should be deltetedhints
- the hints that should be used
BaseLayerException
- in case of failure of underlying storage systempublic boolean existsBinaryContent(RawContentLocation location, BasicStorageHints hints) throws BaseLayerException
existsBinaryContent
in interface RawFileContentManager
location
- the location of the content
BaseLayerException
- in case of failure of underlying storage systempublic 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 void ensureResponsibleFor(RawContentLocation rcl) throws ValueNotValidException
ValueNotValidException
public java.lang.String getDataProvider()
getDataProvider
in interface RawFileContentManager
public boolean supportsAppending()
supportsAppending
in interface RawFileContentManager
BasicStorageHints#HINT_NAME_APPEND_CONTENT
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.public static GridFTPContentManager getManagerInstance(java.lang.String[] params, java.lang.String managerName) throws BaseLayerException
params
- the first String contains the URL 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 managerpublic void setCredentialsProvider(CredentialsProvider provider)
public java.lang.String getUniqueStorageLocationIDFor(java.lang.String objectID)
getUniqueStorageLocationIDFor
in interface RawFileContentManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |