public class FileToolsUtil extends Object
Constructor and Description |
---|
FileToolsUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isStdin(InOutToolOptions tool)
Test whether the input is the stdin
|
static boolean |
isStdout(InOutToolOptions tool)
Test whether the requested output is stdout.
|
static List<File> |
validateLocalInput(InOutToolOptions tool)
Validate the (local) input from an
InOutToolOptions and return
the corresponding file. |
static File |
validateLocalOutput(InOutToolOptions tool)
Validate the (local) ouput from an
InOutToolOptions and return
the corresponding file. |
static File |
validateLocalOutput(String out,
boolean overwrite)
Validate the (local) ouput from an String and return the corresponding
file.
|
static File |
validateLocalOutput(String out,
boolean overwrite,
boolean contin)
Validate the (local) ouput from an String and return the corresponding
file.
|
public FileToolsUtil()
public static List<File> validateLocalInput(InOutToolOptions tool) throws IOException
InOutToolOptions
and return
the corresponding file.tool
- the tool from which to get settingsIOException
- if the file doesn't existpublic static boolean isStdin(InOutToolOptions tool)
tool
- public static boolean isStdout(InOutToolOptions tool)
tool
- the tool from which to get settingspublic static File validateLocalOutput(InOutToolOptions tool) throws IOException
InOutToolOptions
and return
the corresponding file.tool
- the tool from which to get settingsIOException
- if the file exists, but can't be deletedpublic static File validateLocalOutput(String out, boolean overwrite) throws IOException
out
- where the file will gooverwrite
- whether to overwrite existing filesIOException
- if the file exists, but can't be deletedpublic static File validateLocalOutput(String out, boolean overwrite, boolean contin) throws IOException
out
- where the file will gooverwrite
- whether to overwrite existing filescontin
- whether an existing output should be continued (i.e. ignored
if it exists)IOException
- if the file exists, but can't be deleted