org.jboss.shotoku.common.content
Class NodeContent

java.lang.Object
  extended by org.jboss.shotoku.common.content.NodeContent
Direct Known Subclasses:
FileNodeContent

public class NodeContent
extends java.lang.Object

Node content helper class, for converting between various formats.

Author:
Adam Warski (adamw@aster.pl), Damon Sicore (damon@sicore.com)

Constructor Summary
NodeContent()
           
NodeContent(byte[] byteContent)
           
 
Method Summary
 byte[] asByteArray()
           
 java.io.InputStream asInputStream()
           
 java.lang.String asString()
           
 void copyFrom(NodeContent content)
          Copies content to from the given object.
 void copyToFile(java.io.File file)
           
 void finalize()
           
 boolean getChanged()
           
 long getLength()
           
 java.io.OutputStream getOutputStream()
           
 boolean isLarge()
           
 void markUnchanged()
          Makes the content marked as not-changed.
 void setContent(byte[] bytes)
           
 void setContent(java.io.InputStream is)
           
 void setContent(java.lang.String content)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeContent

public NodeContent()

NodeContent

public NodeContent(byte[] byteContent)
Method Detail

asString

public java.lang.String asString()

asByteArray

public byte[] asByteArray()

asInputStream

public java.io.InputStream asInputStream()

setContent

public void setContent(java.io.InputStream is)
                throws java.io.IOException
Throws:
java.io.IOException

setContent

public void setContent(java.lang.String content)

setContent

public void setContent(byte[] bytes)

getOutputStream

public java.io.OutputStream getOutputStream()

copyToFile

public void copyToFile(java.io.File file)
                throws java.io.FileNotFoundException,
                       java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

getChanged

public boolean getChanged()

markUnchanged

public void markUnchanged()
Makes the content marked as not-changed. This should be called after the content has been saved.


getLength

public long getLength()

copyFrom

public void copyFrom(NodeContent content)
Copies content to from the given object. The old object shouldn't be used after being copied (in fact, only when it holds a temporary file reference, but you never know).

Parameters:
content - Content to copy.

isLarge

public boolean isLarge()

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


Copyright © -2006 . All Rights Reserved.