Package org.h2.samples
Class CreateScriptFile
java.lang.Object
org.h2.samples.CreateScriptFile
This sample application shows how to manually
create an encrypted and compressed script file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThis method is called when executing this sample application from the command line.static LineNumberReaderopenScriptReader(String fileName, String compressionAlgorithm, String cipher, String password, String charset) Open a script reader.static PrintWriteropenScriptWriter(String fileName, String compressionAlgorithm, String cipher, String password, String charset) Open a script writer.
-
Constructor Details
-
CreateScriptFile
public CreateScriptFile()
-
-
Method Details
-
main
This method is called when executing this sample application from the command line.- Parameters:
args- the command line parameters- Throws:
Exception- on failure
-
openScriptWriter
public static PrintWriter openScriptWriter(String fileName, String compressionAlgorithm, String cipher, String password, String charset) throws IOException Open a script writer.- Parameters:
fileName- the file name (the file will be overwritten)compressionAlgorithm- the compression algorithm (uppercase)cipher- the encryption algorithm or nullpassword- the encryption passwordcharset- the character set (for example UTF-8)- Returns:
- the print writer
- Throws:
IOException- on failure
-
openScriptReader
public static LineNumberReader openScriptReader(String fileName, String compressionAlgorithm, String cipher, String password, String charset) throws IOException Open a script reader.- Parameters:
fileName- the file name (the file will be overwritten)compressionAlgorithm- the compression algorithm (uppercase)cipher- the encryption algorithm or nullpassword- the encryption passwordcharset- the character set (for example UTF-8)- Returns:
- the script reader
- Throws:
IOException- on failure
-