|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.util.CommandLineUtility
org.moeaframework.util.io.FileProtection
public class FileProtection
Detects corrupted files using the MD5 message digest in a format compatible
with the Unix command line utility md5sum.
| Field Summary | |
|---|---|
static String |
SAFE_MODE
The property value for safe mode. |
static String |
STRICT_MODE
The property value for strict mode. |
| Method Summary | |
|---|---|
static File |
getDigestFile(File file)
Returns the digest file for the specified file. |
org.apache.commons.cli.Options |
getOptions()
Returns the options made available by this command line utility. |
static void |
main(String[] args)
Starts the command line utility for validating files using message digests. |
static InputStream |
openInputStream(File file)
Returns an InputStream for reading from the specified file and
performs validation on the file when the close method is invoked
on the stream. |
static OutputStream |
openOutputStream(File file)
Returns an OutputStream for writing to the specified file and
saves a digest file for validating its contents when the close
method is invoked. |
static Reader |
openReader(File file)
Returns a Reader wrapping the result from calling
openInputStream with the specified file. |
static Writer |
openWriter(File file)
Returns a Writer wrapping the result from calling
openOutputStream with the specified file. |
void |
run(org.apache.commons.cli.CommandLine commandLine)
Runs this command line utility with the specified command line arguments. |
static void |
validate(File file)
Validates the file. |
| Methods inherited from class org.moeaframework.util.CommandLineUtility |
|---|
getCommandString, setCommandString, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String STRICT_MODE
public static final String SAFE_MODE
| Method Detail |
|---|
public static File getDigestFile(File file)
file - the file to be validated
public static Reader openReader(File file)
throws FileNotFoundException
Reader wrapping the result from calling
openInputStream with the specified file.
file - the file to be opened
Reader wrapping the result from calling
openInputStream with the specified file
FileNotFoundException - if the specified file does not exist
public static InputStream openInputStream(File file)
throws FileNotFoundException
InputStream for reading from the specified file and
performs validation on the file when the close method is invoked
on the stream.
file - the file to the opened and validated
InputStream for reading from the specified file
FileNotFoundException - if the specified file does not exist
public static Writer openWriter(File file)
throws FileNotFoundException
Writer wrapping the result from calling
openOutputStream with the specified file.
file - the file to be opened
Writer wrapping the result from calling
openOutputStream with the specified file
FileNotFoundException - if the specified file does not exist
public static void validate(File file)
throws IOException
file - the file to be validated
IOException - if an I/O error occurred
public static OutputStream openOutputStream(File file)
throws FileNotFoundException
OutputStream for writing to the specified file and
saves a digest file for validating its contents when the close
method is invoked.
file - the file to be opened
OutputStream for writing to the specified file
FileNotFoundException - if the specified file does not existpublic org.apache.commons.cli.Options getOptions()
CommandLineUtility-h,--help option.
Implementations overriding this method and begin with a call to
super.getOptions().
getOptions in class CommandLineUtility
public void run(org.apache.commons.cli.CommandLine commandLine)
throws Exception
CommandLineUtility
run in class CommandLineUtilitycommandLine - the command line arguments
Exception
public static void main(String[] args)
throws Exception
args - the command line arguments
Exception - if an error occurred
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||