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 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
 String getCheckSum()
           
protected  String getHexPresentation(byte[] byteArray)
           
protected  MessageDigest getScriptDigest()
           
protected abstract  InputStream getScriptInputStream()
           
 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 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 MessageDigest getScriptDigest()

getCheckSum

public String getCheckSum()

readScript

protected void readScript()
                   throws IOException
Throws:
IOException

getHexPresentation

protected String getHexPresentation(byte[] byteArray)

getScriptInputStream

protected abstract InputStream getScriptInputStream()


Copyright © 2011. All Rights Reserved.