Class PeptideShakerPathParameters

java.lang.Object
eu.isas.peptideshaker.preferences.PeptideShakerPathParameters

public class PeptideShakerPathParameters extends Object
This class sets the path preferences for the files to read/write.
Author:
Marc Vaudel
  • Constructor Details

    • PeptideShakerPathParameters

      public PeptideShakerPathParameters()
  • 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 an FileNotFoundException occurs
      IOException - thrown if an IOException occurs
    • loadPathParametersFromLine

      public static void loadPathParametersFromLine(String line) throws FileNotFoundException, IOException
      Loads a path to be set from a line.
      Parameters:
      line - the line where to read the path from
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • getPathPreference

      public static String getPathPreference(PeptideShakerPathParameters.PeptideShakerPathKey peptideShakerPathKey) throws IOException
      Sets the path according to the given key and path.
      Parameters:
      peptideShakerPathKey - the key of the path
      Returns:
      returns the path used
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • setPathPreference

      public static void setPathPreference(PeptideShakerPathParameters.PeptideShakerPathKey peptideShakerPathKey, String path) throws IOException
      Sets the path according to the given key and path.
      Parameters:
      peptideShakerPathKey - the key of the path
      path - the path to be set
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • setPathParameters

      public static void setPathParameters(com.compomics.software.settings.PathKey pathKey, String path) throws IOException
      Sets the path according to the given key and path.
      Parameters:
      pathKey - the key of the path
      path - the path to be set
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • setAllPathsIn

      public static void setAllPathsIn(String path) throws FileNotFoundException, IOException
      Sets all the paths inside a given folder.
      Parameters:
      path - the path of the folder where to redirect all paths.
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • writeConfigurationToFile

      public static void writeConfigurationToFile(File file) throws IOException
      Writes all path configurations to the given file.
      Parameters:
      file - the destination file
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • writeConfigurationToFile

      public static void writeConfigurationToFile(com.compomics.util.io.flat.SimpleFileWriter writer) throws IOException
      Writes the configuration file using the provided buffered writer.
      Parameters:
      writer - the writer to use for writing.
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • writePathToFile

      public static void writePathToFile(com.compomics.util.io.flat.SimpleFileWriter writer, PeptideShakerPathParameters.PeptideShakerPathKey pathKey) throws IOException
      Writes the path of interest using the provided buffered writer.
      Parameters:
      writer - the writer to use for writing
      pathKey - the key of the path of interest
      Throws:
      FileNotFoundException - thrown if an FileNotFoundException occurs
      IOException
    • getErrorKeys

      public static ArrayList<com.compomics.software.settings.PathKey> getErrorKeys() throws IOException
      Returns a list containing the keys of the paths where the tool is not able to write.
      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