Class FileNaming
java.lang.Object
fr.ens.biologie.genomique.eoulsan.core.FileNaming
- Direct Known Subclasses:
WorkflowFileNaming
This class contains methods to create workflow data file names.
- Since:
- 2.0
- Author:
- Laurent Jourdren
-
Method Summary
Modifier and TypeMethodDescriptionReturn the filename using Eoulsan 1.x naming.static booleandataEquals(DataFile file1, DataFile file2) Test if two files are related to the same data.static booleandataEquals(File file1, File file2) Test if two files are related to the same data.static booleandataEquals(String filename1, String filename2) Test if two filenames are related to the same data.static booleandataEquals(Path file1, Path file2) Test if two files are related to the same data.Return the middle string of the filename.static StringfileMiddle(String dataName, int fileIndex, int part) Create the middle of a filename.filename()Return the filename.static Stringfilename(String stepId, String portName, DataFormat format, String dataName, int fileIndex, int part, fr.ens.biologie.genomique.kenetre.io.CompressionType compression) Create the filename from several parameters.Return the file prefix.static StringfilePrefix(String stepId, String portName, DataFormat format) Create the prefix of a filename.static StringfilePrefix(String stepId, String portName, String formatPrefix) Create the prefix of a filename.Return the file suffix.static StringfileSuffix(DataFormat format, fr.ens.biologie.genomique.kenetre.io.CompressionType compression) Create the suffix of a file.static StringfileSuffix(String extension, String compression) Create the suffix of a file.fr.ens.biologie.genomique.kenetre.io.CompressionTypeGet the compression.Get the data name.intGet the file index.Get the format.intgetPart()Get the file part.Get the port name.intGet the sample number related to the data.Get Step Id.glob()Get a glob for the filename.static booleanisDataNameValid(String dataName) Test if a data name is valid.static booleanisFilenameValid(DataFile file) Test if a filename is valid.static booleanisFilenameValid(File file) Test if a filename is valid.static booleanisFilenameValid(String filename) Test if a filename is valid.static booleanisFilenameValid(Path file) Test if a filename is valid.static booleanisFormatPrefixValid(String formatPrefix) Test if a format prefix id is valid.static booleanisPortNameValid(String portName) Test if a port name is valid.static booleanisStepIdValid(String stepId) Test if a step id is valid.static FileNamingCreate a FileNaming object from a DataFile object.static FileNamingCreate a FileNaming object from a File object.static FileNamingCreate a FileNaming object from a filename.static FileNamingCreate a FileNaming object from a File object.voidsetCompression(fr.ens.biologie.genomique.kenetre.io.CompressionType compression) Set the compressionvoidsetDataName(String dataName) Set the data name.voidsetFileIndex(int fileIndex) Set the file index.voidsetFormat(DataFormat format) Set the format.voidsetPart(int part) Set the part number.voidsetPortName(String portName) Set the port name.voidsetSampleNumber(int sampleNumber) Set the sample number related to the data.voidSet the step id.
-
Method Details
-
getStepId
Get Step Id.- Returns:
- the step Id
-
getPortName
Get the port name.- Returns:
- the port name
-
getDataName
Get the data name.- Returns:
- the data name
-
getSampleNumber
public int getSampleNumber()Get the sample number related to the data. This value is only use when generate compatible filenames.- Returns:
- the number of the sample related to the file or -1 if not known
-
getFormat
Get the format.- Returns:
- the format
-
getFileIndex
public int getFileIndex()Get the file index.- Returns:
- the file index
-
getPart
public int getPart()Get the file part.- Returns:
- the file part
-
getCompression
public fr.ens.biologie.genomique.kenetre.io.CompressionType getCompression()Get the compression.- Returns:
- the compression
-
setStepId
Set the step id.- Parameters:
stepId- the step id
-
setPortName
Set the port name.- Parameters:
portName- the port name
-
setDataName
Set the data name.- Parameters:
dataName- the data name
-
setSampleNumber
public void setSampleNumber(int sampleNumber) Set the sample number related to the data. This value is only use when generate compatible filenames.- Parameters:
sampleNumber- the number of the sample related to the file or -1 if not known
-
setFormat
Set the format.- Parameters:
format- the format
-
setFileIndex
public void setFileIndex(int fileIndex) Set the file index.- Parameters:
fileIndex- the file index
-
setPart
public void setPart(int part) Set the part number.- Parameters:
part- the part number
-
setCompression
public void setCompression(fr.ens.biologie.genomique.kenetre.io.CompressionType compression) Set the compression- Parameters:
compression- the compression type
-
filePrefix
Return the file prefix.- Returns:
- a string with the file prefix
-
fileSuffix
Return the file suffix.- Returns:
- q string with the file suffix
-
fileMiddle
Return the middle string of the filename.- Returns:
- a string with the middle string of the filename
-
filename
Return the filename.- Returns:
- a string with the filename
-
glob
Get a glob for the filename.- Returns:
- a glob in a string
-
compatibilityFilename
Return the filename using Eoulsan 1.x naming.- Returns:
- a string with the filename using Eoulsan 1.x naming
-
filePrefix
Create the prefix of a filename.- Parameters:
stepId- step idportName- port nameformat- format of the file- Returns:
- a String with the prefix of the file
-
filePrefix
Create the prefix of a filename.- Parameters:
stepId- step idportName- port nameformatPrefix- format prefix of the file- Returns:
- a String with the prefix of the file
-
fileMiddle
Create the middle of a filename.- Parameters:
dataName- data namefileIndex- file indexpart- file part- Returns:
- a String with the suffix of a file
-
fileSuffix
public static String fileSuffix(DataFormat format, fr.ens.biologie.genomique.kenetre.io.CompressionType compression) Create the suffix of a file.- Parameters:
format- format of the filecompression- file compression- Returns:
- a String with the suffix of a file
-
fileSuffix
Create the suffix of a file.- Parameters:
extension- file extensioncompression- file compression- Returns:
- a String with the suffix of a file
-
filename
public static String filename(String stepId, String portName, DataFormat format, String dataName, int fileIndex, int part, fr.ens.biologie.genomique.kenetre.io.CompressionType compression) Create the filename from several parameters.- Parameters:
stepId- the step idportName- the port nameformat- the formatdataName- the data namefileIndex- the file indexpart- the partcompression- the compression type- Returns:
- a string with the filename
-
parse
Create a FileNaming object from a File object.- Parameters:
file- the file- Returns:
- a new FileNaming object
-
parse
Create a FileNaming object from a File object.- Parameters:
file- the file- Returns:
- a new FileNaming object
-
parse
Create a FileNaming object from a DataFile object.- Parameters:
file- the file- Returns:
- a new FileNaming object
-
parse
Create a FileNaming object from a filename.- Parameters:
filename- the filename- Returns:
- a new FileNaming object
-
isStepIdValid
Test if a step id is valid.- Parameters:
stepId- the step id to check- Returns:
- true if the step id is valid
-
isFormatPrefixValid
Test if a format prefix id is valid.- Parameters:
formatPrefix- the format prefix to check- Returns:
- true if the format prefix is valid
-
isPortNameValid
Test if a port name is valid.- Parameters:
portName- port name to check- Returns:
- true if the port name is valid
-
isDataNameValid
Test if a data name is valid.- Parameters:
dataName- data name to check- Returns:
- true if the data name is valid
-
isFilenameValid
Test if a filename is valid.- Parameters:
file- the file to test.- Returns:
- true if the filename is valid
-
isFilenameValid
Test if a filename is valid.- Parameters:
file- the file to test.- Returns:
- true if the filename is valid
-
isFilenameValid
Test if a filename is valid.- Parameters:
file- the file to test.- Returns:
- true if the filename is valid
-
isFilenameValid
Test if a filename is valid.- Parameters:
filename- the file to test.- Returns:
- true if the filename is valid
-
dataEquals
Test if two files are related to the same data.- Parameters:
file1- the first filefile2- the second file- Returns:
- true if the two files are related to the same data
-
dataEquals
Test if two files are related to the same data.- Parameters:
file1- the first filefile2- the second file- Returns:
- true if the two files are related to the same data
-
dataEquals
Test if two files are related to the same data.- Parameters:
file1- the first filefile2- the second file- Returns:
- true if the two files are related to the same data
-
dataEquals
Test if two filenames are related to the same data.- Parameters:
filename1- the first filenamefilename2- the second filename- Returns:
- true if the two files are related to the same data
-