Class Tool
java.lang.Object
org.h2.util.Tool
- Direct Known Subclasses:
Backup, ChangeFileEncryption, Console, ConvertTraceFile, CreateCluster, DeleteDbFiles, Recover, Restore, RunScript, Script, Server, Shell
Command line tools implement the tool interface so that they can be used in
the H2 Console.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PrintStreamThe output stream where this tool writes to.private Properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if the argument matches the option.protected voidprintNoDatabaseFilesFound(String dir, String db) Print to the output stream that no database files have been found.abstract voidRun the tool with the given output stream and arguments.voidsetOut(PrintStream out) Sets the standard output stream.protected voidPrint the usage of the tool.protected SQLExceptionThrow a SQLException saying this command line option is not supported.protected SQLExceptionthrowUnsupportedOption(String option) Throw a SQLException saying this command line option is not supported.
-
Field Details
-
out
The output stream where this tool writes to. -
resources
-
-
Constructor Details
-
Tool
public Tool()
-
-
Method Details
-
setOut
Sets the standard output stream.- Parameters:
out- the new standard output stream
-
runTool
Run the tool with the given output stream and arguments.- Parameters:
args- the argument list- Throws:
SQLException- on failure
-
showUsageAndThrowUnsupportedOption
Throw a SQLException saying this command line option is not supported.- Parameters:
option- the unsupported option- Returns:
- this method never returns normally
- Throws:
SQLException- on failure
-
throwUnsupportedOption
Throw a SQLException saying this command line option is not supported.- Parameters:
option- the unsupported option- Returns:
- this method never returns normally
- Throws:
SQLException- on failure
-
printNoDatabaseFilesFound
-
showUsage
protected void showUsage()Print the usage of the tool. This method reads the description from the resource file. -
isOption
-