public class UtilitiesPathPreferences extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UtilitiesPathPreferences.UtilitiesPathKey
Enum of the paths which can be set in utilities
|
Modifier and Type | Field and Description |
---|---|
static String |
separator
The separator between a path ID and a path
|
Constructor and Description |
---|
UtilitiesPathPreferences() |
Modifier and Type | Method and Description |
---|---|
static String |
getPath(String line)
Returns the path at the given line.
|
static String |
getPathID(String line)
Returns the path id line.
|
static void |
loadPathPreferenceFromLine(String line)
Loads a path to be set from a line
|
static void |
loadPathPreferencesFromFile(File inputFile)
Loads the path preferences from a text file.
|
static void |
setAllPathsIn(String path)
Sets all the paths inside a given folder.
|
static void |
setPathPreference(UtilitiesPathPreferences.UtilitiesPathKey utilitiesPathKey,
String path)
Sets the path according to the given key and path
|
static void |
writeConfigurationToFile(BufferedWriter bw) |
static void |
writeConfigurationToFile(File file)
Writes all path configurations to the given file.
|
static void |
writePathToFile(BufferedWriter bw,
UtilitiesPathPreferences.UtilitiesPathKey pathKey)
Writes the path of interest using the provided buffered writer.
|
public static final String separator
public static void loadPathPreferencesFromFile(File inputFile) throws FileNotFoundException, IOException
inputFile
- the file to load the path preferences fromFileNotFoundException
IOException
public static void loadPathPreferenceFromLine(String line) throws FileNotFoundException
line
- the line where to read the path fromFileNotFoundException
public static void setPathPreference(UtilitiesPathPreferences.UtilitiesPathKey utilitiesPathKey, String path)
utilitiesPathKey
- the key of the pathpath
- the path to be setpublic static String getPathID(String line)
line
- the line of interestpublic static String getPath(String line)
line
- the linepublic static void setAllPathsIn(String path) throws FileNotFoundException
path
- the path of the folder where to redirect all paths.FileNotFoundException
public static void writeConfigurationToFile(File file) throws IOException
file
- the destination fileIOException
public static void writeConfigurationToFile(BufferedWriter bw) throws IOException
bw
- the writer to use for writingIOException
public static void writePathToFile(BufferedWriter bw, UtilitiesPathPreferences.UtilitiesPathKey pathKey) throws IOException
bw
- the writer to use for writingpathKey
- the key of the path of interestIOException
Copyright © 2014. All rights reserved.