Class AnnotationDataProtocol
java.lang.Object
fr.ens.biologie.genomique.eoulsan.data.protocols.DeprecatedDataProtocol
fr.ens.biologie.genomique.eoulsan.data.protocols.AnnotationDataProtocol
- All Implemented Interfaces:
DataProtocol
This class define a annotation protocol.
- Since:
- 1.1
- Author:
- Laurent Jourdren
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest 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.booleanTest if the renameTo() method is available with this protocol.booleanTest if the symlink() method is available with this protocol.voidDelete a file.Get the parent source of the source.getName()Get Protocol name.getSourceAsFile(DataFile src) Get the underlying File object for the DataFile if the protocol allow it.getSourceAsPath(DataFile src) Get the underlying File object for the DataFile if the protocol allow it.getSourceFilename(String source) Get the name of the filename that correspond to the source.List a directory.voidCreate a directory.voidCreate a directory and its parents if not exists.voidCopy data from a source to a destination sourceputData(DataFile src, DataFileMetadata md) Create an OutputStream from the source.voidRename a file.voidCreate a symbolic link.Methods inherited from class fr.ens.biologie.genomique.eoulsan.data.protocols.DeprecatedDataProtocol
canRead, canWrite, exists, getData, getMetadata, putData
-
Field Details
-
PROTOCOL_NAME
- See Also:
-
-
Constructor Details
-
AnnotationDataProtocol
public AnnotationDataProtocol()Public constructor.
-
-
Method Details
-
getName
Description copied from interface:DataProtocolGet Protocol name.- Returns:
- the name of the protocol
-
getSourceFilename
Description copied from interface:DataProtocolGet the name of the filename that correspond to the source.- Specified by:
getSourceFilenamein interfaceDataProtocol- Parameters:
source- the source- Returns:
- a String with the filename
-
getDataFileParent
Description copied from interface:DataProtocolGet the parent source of the source.- Specified by:
getDataFileParentin interfaceDataProtocol- Parameters:
src- source to use- Returns:
- a String with the source of the parent or null if there is parent
-
putData
Description copied from interface:DataProtocolCreate an OutputStream from the source.- Specified by:
putDatain interfaceDataProtocol- Parameters:
src- source to usemd- metadata for the stream to write- Returns:
- an OutputStream
- Throws:
IOException- if an error occurs while creating the OutputStream
-
putData
Description copied from interface:DataProtocolCopy data from a source to a destination source- Specified by:
putDatain interfaceDataProtocol- Parameters:
src- source sourcedest- destination source- Throws:
IOException- if an error occurs while copying data
-
getSourceAsFile
Description copied from interface:DataProtocolGet the underlying File object for the DataFile if the protocol allow it.- Specified by:
getSourceAsFilein interfaceDataProtocol- Parameters:
src- source DataFile- Returns:
- a File object or null if the protocol does not allow it
-
getSourceAsPath
Description copied from interface:DataProtocolGet the underlying File object for the DataFile if the protocol allow it.- Specified by:
getSourceAsPathin interfaceDataProtocol- Parameters:
src- source DataFile- Returns:
- a File object or null if the protocol does not allow it
-
mkdir
Description copied from interface:DataProtocolCreate a directory.- Specified by:
mkdirin interfaceDataProtocol- Parameters:
dir- directory to create- Throws:
IOException- if an error occurs while creating the directory
-
mkdirs
Description copied from interface:DataProtocolCreate a directory and its parents if not exists.- Specified by:
mkdirsin interfaceDataProtocol- Parameters:
dir- directory to create- Throws:
IOException- if an error occurs while creating the directory
-
canMkdir
public boolean canMkdir()Description copied from interface:DataProtocolTest if the mkdir() and mkdirs() methods are available with this protocol.- Specified by:
canMkdirin interfaceDataProtocol- Returns:
- true if mkdir() and mkdirs() are available
-
symlink
Description copied from interface:DataProtocolCreate a symbolic link.- Specified by:
symlinkin interfaceDataProtocol- Parameters:
target- target filelink- symbolic link file- Throws:
IOException- if an error occurs while creating the symbolic link
-
canSymlink
public boolean canSymlink()Description copied from interface:DataProtocolTest if the symlink() method is available with this protocol.- Specified by:
canSymlinkin interfaceDataProtocol- Returns:
- true if symlink() is available
-
delete
Description copied from interface:DataProtocolDelete a file.- Specified by:
deletein interfaceDataProtocol- Parameters:
file- file to deleterecursive- recursive deletion- Throws:
IOException- if an error occurs while deleting the file
-
canDelete
public boolean canDelete()Description copied from interface:DataProtocolTest if the delete() method is available with this protocol.- Specified by:
canDeletein interfaceDataProtocol- Returns:
- true if delete() is available
-
list
Description copied from interface:DataProtocolList a directory.- Specified by:
listin interfaceDataProtocol- Parameters:
file- directory to list- Returns:
- a list of DataFile objects
- Throws:
IOException- if an error occurs while listing the directory
-
canList
public boolean canList()Description copied from interface:DataProtocolTest if the list() method is available with this protocol.- Specified by:
canListin interfaceDataProtocol- Returns:
- true if list() is available
-
canRename
public boolean canRename()Description copied from interface:DataProtocolTest if the renameTo() method is available with this protocol.- Specified by:
canRenamein interfaceDataProtocol- Returns:
- true if renameTo() is available
-
rename
Description copied from interface:DataProtocolRename a file.- Specified by:
renamein interfaceDataProtocol- Parameters:
oldName- the file to renamenewName- the destination file- Throws:
IOException- if an error occurs while renaming the directory
-