org.unitils.dbmaintainer.script
Class ScriptContentHandle

java.lang.Object
  extended by org.unitils.dbmaintainer.script.ScriptContentHandle
Direct Known Subclasses:
ScriptContentHandle.StringScriptContentHandle, ScriptContentHandle.UrlScriptContentHandle

public abstract class ScriptContentHandle
extends java.lang.Object

A handle for getting the script content as a stream.

Author:
Tim Ducheyne, Filip Neven

Nested Class Summary
static class ScriptContentHandle.StringScriptContentHandle
          A handle for getting the script content as a stream.
static class ScriptContentHandle.UrlScriptContentHandle
          A handle for getting the script content as a stream.
 
Constructor Summary
ScriptContentHandle()
           
 
Method Summary
 java.lang.String getCheckSum()
           
protected  java.lang.String getHexPresentation(byte[] byteArray)
           
protected  java.security.MessageDigest getScriptDigest()
           
protected abstract  java.io.InputStream getScriptInputStream()
           
 java.io.Reader openScriptContentReader()
          Opens a stream to the content of the script.
protected  void readScript()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptContentHandle

public ScriptContentHandle()
Method Detail

openScriptContentReader

public java.io.Reader openScriptContentReader()
Opens a stream to the content of the script. NOTE: do not forget to close the stream after usage.

Returns:
The content stream, not null

getScriptDigest

protected java.security.MessageDigest getScriptDigest()

getCheckSum

public java.lang.String getCheckSum()

readScript

protected void readScript()
                   throws java.io.IOException
Throws:
java.io.IOException

getHexPresentation

protected java.lang.String getHexPresentation(byte[] byteArray)

getScriptInputStream

protected abstract java.io.InputStream getScriptInputStream()


Copyright © 2009. All Rights Reserved.