public class CommandLineUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SEPARATOR
The command line argument separator.
|
Constructor and Description |
---|
CommandLineUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
concatenate(ArrayList<String> args)
Returns the list of arguments as space separated string for the command
line.
|
static String |
concatenate(String[] args)
Returns the list of arguments as space separated string for the command
line.
|
static String |
getCommandLineArgument(ArrayList<File> files)
Returns the list of file as argument for the command line.
|
static String |
getCommandLineArgument(File file)
Returns the file as argument for the command line.
|
static ArrayList<Double> |
getDoubleListFromString(String aString,
String separator)
Parses a list of doubles from a command line option.
|
static ArrayList<File> |
getFiles(String optionInput,
ArrayList<String> fileExtentions)
Returns a list of files as imported from the command line option.
|
static ArrayList<Integer> |
getIntegerListFromString(String aString,
String separator)
Parses a list of integers from a command line option.
|
static String |
getQuoteType()
Returns the quote type to use.
|
static ArrayList<String> |
splitInput(String cliInput)
Splits the input of comma separated command line input and returns the
results as an arraylist.
|
public static final String SEPARATOR
public static String getCommandLineArgument(ArrayList<File> files)
files
- the filespublic static String concatenate(ArrayList<String> args)
args
- the argumentspublic static String concatenate(String[] args)
args
- the argumentspublic static String getQuoteType()
public static String getCommandLineArgument(File file)
file
- the filepublic static ArrayList<String> splitInput(String cliInput)
cliInput
- the CLI inputpublic static ArrayList<File> getFiles(String optionInput, ArrayList<String> fileExtentions) throws FileNotFoundException
optionInput
- the command line optionfileExtentions
- the file extensions to be consideredFileNotFoundException
- exception thrown whenever a file is not
foundpublic static ArrayList<Integer> getIntegerListFromString(String aString, String separator)
aString
- the command line optionseparator
- the separator used to separate the stringCopyright © 2016. All rights reserved.