Package eu.isas.searchgui.parameters
Class SearchGUIPathParameters
java.lang.Object
eu.isas.searchgui.parameters.SearchGUIPathParameters
This class sets the path preferences for the files to read/write
- Author:
- Marc Vaudel, Harald Barsnes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum of the paths which can be set in SearchGUI. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<com.compomics.software.settings.PathKey> getErrorKeys(File configFolder) Returns a list containing the keys of the paths where the tool is not able to write.Returns the path to the jar file.static StringgetPathParameter(SearchGUIPathParameters.SearchGUIPathKey searchGUIPathKey, File configFolder) Returns the path according to the given key and path.static voidLoads a path to be set from a line.static voidloadPathParametersFromFile(File inputFile) Loads the path preferences from a text file.static voidsetAllPathsIn(String path) Sets all the paths inside a given folder.static voidsetPathParameter(com.compomics.software.settings.PathKey pathKey, String path) Sets the path according to the given key and path.static voidsetPathParameter(SearchGUIPathParameters.SearchGUIPathKey searchGUIPathKey, String path) Sets the path according to the given key and path.static voidwriteConfigurationToFile(com.compomics.util.io.flat.SimpleFileWriter writer, File configFolder) Writes all path configurations to the given file.static voidwriteConfigurationToFile(File file, File configFolder) Writes all path configurations to the given file.static voidwritePathToFile(com.compomics.util.io.flat.SimpleFileWriter writer, SearchGUIPathParameters.SearchGUIPathKey pathKey, File configFolder) Writes the path of interest using the provided buffered writer.
-
Constructor Details
-
SearchGUIPathParameters
public SearchGUIPathParameters()
-
-
Method Details
-
loadPathParametersFromFile
public static void loadPathParametersFromFile(File inputFile) throws FileNotFoundException, IOException Loads the path preferences from a text file.- Parameters:
inputFile- the file to load the path preferences from- Throws:
FileNotFoundException- thrown if the input file is not foundIOException- thrown if there are problems reading the input file
-
loadPathParameterFromLine
Loads a path to be set from a line.- Parameters:
line- the line where to read the path from- Throws:
FileNotFoundException- thrown if the file the path refers to cannot be found
-
setPathParameter
public static void setPathParameter(SearchGUIPathParameters.SearchGUIPathKey searchGUIPathKey, String path) Sets the path according to the given key and path.- Parameters:
searchGUIPathKey- the key of the pathpath- the path to be set
-
setPathParameter
Sets the path according to the given key and path.- Parameters:
pathKey- the key of the pathpath- the path to be set
-
getPathParameter
public static String getPathParameter(SearchGUIPathParameters.SearchGUIPathKey searchGUIPathKey, File configFolder) Returns the path according to the given key and path.- Parameters:
searchGUIPathKey- the key of the pathconfigFolder- the config folder- Returns:
- the path
-
setAllPathsIn
Sets all the paths inside a given folder.- Parameters:
path- the path of the folder where to redirect all paths.- Throws:
FileNotFoundException- thrown if on of the files the paths refer to cannot be found
-
writeConfigurationToFile
Writes all path configurations to the given file.- Parameters:
file- the destination fileconfigFolder- config folder- Throws:
IOException- thrown of the file cannot be found
-
writeConfigurationToFile
public static void writeConfigurationToFile(com.compomics.util.io.flat.SimpleFileWriter writer, File configFolder) throws IOException Writes all path configurations to the given file.- Parameters:
writer- the writer to use for writingconfigFolder- the config folder- Throws:
IOException- thrown of the file cannot be found
-
writePathToFile
public static void writePathToFile(com.compomics.util.io.flat.SimpleFileWriter writer, SearchGUIPathParameters.SearchGUIPathKey pathKey, File configFolder) throws IOException Writes the path of interest using the provided buffered writer.- Parameters:
writer- the writer to use for writingpathKey- the key of the path of interestconfigFolder- the config folder- Throws:
IOException- thrown of the file cannot be found
-
getErrorKeys
public static ArrayList<com.compomics.software.settings.PathKey> getErrorKeys(File configFolder) throws IOException Returns a list containing the keys of the paths where the tool is not able to write.- Parameters:
configFolder- the config folder- Returns:
- a list containing the keys of the paths where the tool is not able to write
- Throws:
IOException- exception thrown whenever an error occurred while loading the path configuration
-
getJarFilePath
Returns the path to the jar file.- Returns:
- the path to the jar file
-