Class HTTPSURLDataProtocol
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.data.protocols.URLDataProtocol
-
- fr.ens.biologie.genomique.eoulsan.data.protocols.HTTPSURLDataProtocol
-
- All Implemented Interfaces:
DataProtocol
public class HTTPSURLDataProtocol extends URLDataProtocol
This class define the http protocol in local mode.- Since:
- 2.0
- Author:
- Laurent Jourdren
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROTOCOL_NAME
Protocol name.
-
Constructor Summary
Constructors Constructor Description HTTPSURLDataProtocol()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDelete()
Test if the delete() method is available with this protocol.boolean
canList()
Test if the list() method is available with this protocol.boolean
canMkdir()
Test if the mkdir() and mkdirs() methods are available with this protocol.boolean
canRename()
Test if the renameTo() method is available with this protocol.boolean
canSymlink()
Test if the symlink() method is available with this protocol.void
delete(DataFile file, boolean recursive)
Delete a file.DataFile
getDataFileParent(DataFile src)
Get the parent source of the source.String
getName()
Get Protocol name.File
getSourceAsFile(DataFile src)
Get the underlying File object for the DataFile if the protocol allow it.String
getSourceFilename(String source)
Get the name of the filename that correspond to the source.List<DataFile>
list(DataFile file)
List a directory.void
mkdir(DataFile dir)
Create a directory.void
mkdirs(DataFile dir)
Create a directory and its parents if not exists.void
putData(DataFile src, DataFile dest)
Copy data from a source to a destination sourceOutputStream
putData(DataFile src, DataFileMetadata md)
Create an OutputStream from the source.void
rename(DataFile oldName, DataFile newName)
Rename a file.void
symlink(DataFile target, DataFile link)
Create a symbolic link.-
Methods inherited from class fr.ens.biologie.genomique.eoulsan.data.protocols.URLDataProtocol
canRead, canWrite, exists, getData, getMetadata, putData
-
-
-
-
Field Detail
-
PROTOCOL_NAME
public static final String PROTOCOL_NAME
Protocol name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:DataProtocol
Get Protocol name.- Returns:
- the name of the protocol
-
getSourceFilename
public String getSourceFilename(String source)
Description copied from interface:DataProtocol
Get the name of the filename that correspond to the source.- Specified by:
getSourceFilename
in interfaceDataProtocol
- Parameters:
source
- the source- Returns:
- a String with the filename
-
getDataFileParent
public DataFile getDataFileParent(DataFile src)
Description copied from interface:DataProtocol
Get the parent source of the source.- Specified by:
getDataFileParent
in interfaceDataProtocol
- Parameters:
src
- source to use- Returns:
- a String with the source of the parent or null if there is parent
-
putData
public OutputStream putData(DataFile src, DataFileMetadata md) throws IOException
Description copied from interface:DataProtocol
Create an OutputStream from the source.- Specified by:
putData
in 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
public void putData(DataFile src, DataFile dest) throws IOException
Description copied from interface:DataProtocol
Copy data from a source to a destination source- Specified by:
putData
in interfaceDataProtocol
- Parameters:
src
- source sourcedest
- destination source- Throws:
IOException
- if an error occurs while copying data
-
getSourceAsFile
public File getSourceAsFile(DataFile src)
Description copied from interface:DataProtocol
Get the underlying File object for the DataFile if the protocol allow it.- Specified by:
getSourceAsFile
in interfaceDataProtocol
- Returns:
- a File object or null if the protocol does not allow it
-
mkdir
public void mkdir(DataFile dir) throws IOException
Description copied from interface:DataProtocol
Create a directory.- Specified by:
mkdir
in interfaceDataProtocol
- Parameters:
dir
- directory to create- Throws:
IOException
- if an error occurs while creating the directory
-
mkdirs
public void mkdirs(DataFile dir) throws IOException
Description copied from interface:DataProtocol
Create a directory and its parents if not exists.- Specified by:
mkdirs
in interfaceDataProtocol
- Parameters:
dir
- directory to create- Throws:
IOException
- if an error occurs while creating the directory
-
canMkdir
public boolean canMkdir()
Description copied from interface:DataProtocol
Test if the mkdir() and mkdirs() methods are available with this protocol.- Specified by:
canMkdir
in interfaceDataProtocol
- Returns:
- true if mkdir() and mkdirs() are available
-
symlink
public void symlink(DataFile target, DataFile link) throws IOException
Description copied from interface:DataProtocol
Create a symbolic link.- Specified by:
symlink
in 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:DataProtocol
Test if the symlink() method is available with this protocol.- Specified by:
canSymlink
in interfaceDataProtocol
- Returns:
- true if symlink() is available
-
delete
public void delete(DataFile file, boolean recursive) throws IOException
Description copied from interface:DataProtocol
Delete a file.- Specified by:
delete
in 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:DataProtocol
Test if the delete() method is available with this protocol.- Specified by:
canDelete
in interfaceDataProtocol
- Returns:
- true if delete() is available
-
list
public List<DataFile> list(DataFile file) throws IOException
Description copied from interface:DataProtocol
List a directory.- Specified by:
list
in 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:DataProtocol
Test if the list() method is available with this protocol.- Specified by:
canList
in interfaceDataProtocol
- Returns:
- true if list() is available
-
canRename
public boolean canRename()
Description copied from interface:DataProtocol
Test if the renameTo() method is available with this protocol.- Specified by:
canRename
in interfaceDataProtocol
- Returns:
- true if renameTo() is available
-
rename
public void rename(DataFile oldName, DataFile newName) throws IOException
Description copied from interface:DataProtocol
Rename a file.- Specified by:
rename
in interfaceDataProtocol
- Parameters:
oldName
- the file to renamenewName
- the destination file- Throws:
IOException
- if an error occurs while renaming the directory
-
-