org.h2.samples
Class CreateScriptFile

java.lang.Object
  extended by org.h2.samples.CreateScriptFile

public class CreateScriptFile
extends java.lang.Object

This sample application shows how to manually create an encrypted and compressed script file.


Constructor Summary
CreateScriptFile()
           
 
Method Summary
static void main(java.lang.String... args)
          This method is called when executing this sample application from the command line.
static java.io.LineNumberReader openScriptReader(java.lang.String fileName, java.lang.String compressionAlgorithm, java.lang.String cipher, java.lang.String password, java.lang.String charset)
          Open a script reader.
static java.io.PrintWriter openScriptWriter(java.lang.String fileName, java.lang.String compressionAlgorithm, java.lang.String cipher, java.lang.String password, java.lang.String charset)
          Open a script writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateScriptFile

public CreateScriptFile()
Method Detail

main

public static void main(java.lang.String... args)
                 throws java.lang.Exception
This method is called when executing this sample application from the command line.

Parameters:
args - the command line parameters
Throws:
java.lang.Exception

openScriptWriter

public static java.io.PrintWriter openScriptWriter(java.lang.String fileName,
                                                   java.lang.String compressionAlgorithm,
                                                   java.lang.String cipher,
                                                   java.lang.String password,
                                                   java.lang.String charset)
                                            throws java.io.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 null
password - the encryption password
charset - the character set (for example UTF-8)
Returns:
the print writer
Throws:
java.io.IOException

openScriptReader

public static java.io.LineNumberReader openScriptReader(java.lang.String fileName,
                                                        java.lang.String compressionAlgorithm,
                                                        java.lang.String cipher,
                                                        java.lang.String password,
                                                        java.lang.String charset)
                                                 throws java.io.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 null
password - the encryption password
charset - the character set (for example UTF-8)
Returns:
the script reader
Throws:
java.io.IOException