org.dbmaintain.script
Class ScriptContentHandle
java.lang.Object
org.dbmaintain.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, Jessica Austin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
scriptDigest
protected MessageDigest scriptDigest
scriptReader
protected Reader scriptReader
encoding
protected String encoding
ignoreCarriageReturnsWhenCalculatingCheckSum
protected boolean ignoreCarriageReturnsWhenCalculatingCheckSum
ScriptContentHandle
protected ScriptContentHandle(String encoding,
boolean ignoreCarriageReturnsWhenCalculatingCheckSum)
- Parameters:
encoding
- The encoding of the script, not nullignoreCarriageReturnsWhenCalculatingCheckSum
- If true, carriage return chars will be ignored when calculating check sums
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
getCheckSum
public String getCheckSum()
getScriptDigest
protected MessageDigest getScriptDigest()
throws IOException
- Throws:
IOException
getScriptContentsAsString
public String getScriptContentsAsString(long maxNrChars)
getHexPresentation
protected String getHexPresentation(byte[] byteArray)
getScriptInputStream
protected abstract InputStream getScriptInputStream()
- NOTE: Make sure you don't forget to close the stream!
- Returns:
- stream providing access to the script content, not null
Copyright © 2011. All Rights Reserved.