Class FTPPathDataProtocol
- java.lang.Object
- 
- fr.ens.biologie.genomique.eoulsan.data.protocols.PathDataProtocol
- 
- fr.ens.biologie.genomique.eoulsan.data.protocols.FTPPathDataProtocol
 
 
- 
- All Implemented Interfaces:
- DataProtocol
 
 public class FTPPathDataProtocol extends PathDataProtocol This class define the FTP protocol in Hadoop mode.- Since:
- 1.0
- Author:
- Laurent Jourdren
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringPROTOCOL_NAMEProtocol name.- 
Fields inherited from class fr.ens.biologie.genomique.eoulsan.data.protocols.PathDataProtocolconf
 
- 
 - 
Constructor SummaryConstructors Constructor Description FTPPathDataProtocol()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDelete()Test if the delete() method is available with this protocol.booleancanList()Test if the list() method is available with this protocol.booleancanMkdir()Test if the mkdir() and mkdirs() methods are available with this protocol.booleancanRename()Test if the renameTo() method is available with this protocol.booleancanSymlink()Test if the symlink() method is available with this protocol.voiddelete(DataFile file, boolean recursive)Delete a file.DataFilegetDataFileParent(DataFile src)Get the parent source of the source.StringgetName()Get Protocol name.FilegetSourceAsFile(DataFile src)Get the underlying File object for the DataFile if the protocol allow it.StringgetSourceFilename(String source)Get the name of the filename that correspond to the source.List<DataFile>list(DataFile file)List a directory.voidmkdir(DataFile dir)Create a directory.voidmkdirs(DataFile dir)Create a directory and its parents if not exists.voidputData(DataFile src, DataFile dest)Copy data from a source to a destination sourceOutputStreamputData(DataFile src, DataFileMetadata md)Create an OutputStream from the source.voidrename(DataFile oldName, DataFile newName)Rename a file.voidsymlink(DataFile target, DataFile link)Create a symbolic link.- 
Methods inherited from class fr.ens.biologie.genomique.eoulsan.data.protocols.PathDataProtocolcanRead, canWrite, exists, getData, getMetadata, getPath, putData
 
- 
 
- 
- 
- 
Field Detail- 
PROTOCOL_NAMEpublic static final String PROTOCOL_NAME Protocol name.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Description copied from interface:DataProtocolGet Protocol name.- Returns:
- the name of the protocol
 
 - 
getSourceFilenamepublic String getSourceFilename(String source) Description copied from interface:DataProtocolGet the name of the filename that correspond to the source.- Specified by:
- getSourceFilenamein interface- DataProtocol
- Parameters:
- source- the source
- Returns:
- a String with the filename
 
 - 
getDataFileParentpublic DataFile getDataFileParent(DataFile src) Description copied from interface:DataProtocolGet the parent source of the source.- Specified by:
- getDataFileParentin interface- DataProtocol
- Parameters:
- src- source to use
- Returns:
- a String with the source of the parent or null if there is parent
 
 - 
putDatapublic OutputStream putData(DataFile src, DataFileMetadata md) throws IOException Description copied from interface:DataProtocolCreate an OutputStream from the source.- Specified by:
- putDatain interface- DataProtocol
- Parameters:
- src- source to use
- md- metadata for the stream to write
- Returns:
- an OutputStream
- Throws:
- IOException- if an error occurs while creating the OutputStream
 
 - 
putDatapublic void putData(DataFile src, DataFile dest) throws IOException Description copied from interface:DataProtocolCopy data from a source to a destination source- Specified by:
- putDatain interface- DataProtocol
- Parameters:
- src- source source
- dest- destination source
- Throws:
- IOException- if an error occurs while copying data
 
 - 
getSourceAsFilepublic File getSourceAsFile(DataFile src) Description copied from interface:DataProtocolGet the underlying File object for the DataFile if the protocol allow it.- Specified by:
- getSourceAsFilein interface- DataProtocol
- Returns:
- a File object or null if the protocol does not allow it
 
 - 
mkdirpublic void mkdir(DataFile dir) throws IOException Description copied from interface:DataProtocolCreate a directory.- Specified by:
- mkdirin interface- DataProtocol
- Parameters:
- dir- directory to create
- Throws:
- IOException- if an error occurs while creating the directory
 
 - 
mkdirspublic void mkdirs(DataFile dir) throws IOException Description copied from interface:DataProtocolCreate a directory and its parents if not exists.- Specified by:
- mkdirsin interface- DataProtocol
- Parameters:
- dir- directory to create
- Throws:
- IOException- if an error occurs while creating the directory
 
 - 
canMkdirpublic boolean canMkdir() Description copied from interface:DataProtocolTest if the mkdir() and mkdirs() methods are available with this protocol.- Specified by:
- canMkdirin interface- DataProtocol
- Returns:
- true if mkdir() and mkdirs() are available
 
 - 
symlinkpublic void symlink(DataFile target, DataFile link) throws IOException Description copied from interface:DataProtocolCreate a symbolic link.- Specified by:
- symlinkin interface- DataProtocol
- Parameters:
- target- target file
- link- symbolic link file
- Throws:
- IOException- if an error occurs while creating the symbolic link
 
 - 
canSymlinkpublic boolean canSymlink() Description copied from interface:DataProtocolTest if the symlink() method is available with this protocol.- Specified by:
- canSymlinkin interface- DataProtocol
- Returns:
- true if symlink() is available
 
 - 
deletepublic void delete(DataFile file, boolean recursive) throws IOException Description copied from interface:DataProtocolDelete a file.- Specified by:
- deletein interface- DataProtocol
- Parameters:
- file- file to delete
- recursive- recursive deletion
- Throws:
- IOException- if an error occurs while deleting the file
 
 - 
canDeletepublic boolean canDelete() Description copied from interface:DataProtocolTest if the delete() method is available with this protocol.- Specified by:
- canDeletein interface- DataProtocol
- Returns:
- true if delete() is available
 
 - 
listpublic List<DataFile> list(DataFile file) throws IOException Description copied from interface:DataProtocolList a directory.- Specified by:
- listin interface- DataProtocol
- Parameters:
- file- directory to list
- Returns:
- a list of DataFile objects
- Throws:
- IOException- if an error occurs while listing the directory
 
 - 
canListpublic boolean canList() Description copied from interface:DataProtocolTest if the list() method is available with this protocol.- Specified by:
- canListin interface- DataProtocol
- Returns:
- true if list() is available
 
 - 
canRenamepublic boolean canRename() Description copied from interface:DataProtocolTest if the renameTo() method is available with this protocol.- Specified by:
- canRenamein interface- DataProtocol
- Returns:
- true if renameTo() is available
 
 - 
renamepublic void rename(DataFile oldName, DataFile newName) throws IOException Description copied from interface:DataProtocolRename a file.- Specified by:
- renamein interface- DataProtocol
- Parameters:
- oldName- the file to rename
- newName- the destination file
- Throws:
- IOException- if an error occurs while renaming the directory
 
 
- 
 
-