org.apache.jackrabbit.core.value
Class BLOBFileValue

java.lang.Object
  extended by org.apache.jackrabbit.core.value.BLOBFileValue
Direct Known Subclasses:
BLOBInDataStore, BLOBInMemory, BLOBInResource, BLOBInTempFile, BLOBValue

public abstract class BLOBFileValue
extends Object

Represents binary data which is backed by a resource or byte[]. Unlike BinaryValue it has no state, i.e. the getStream() method always returns a fresh InputStream instance.

Important Note:

This interface is for Jackrabbit-internal use only. Applications should use javax.jcr.ValueFactory to create binary values.


Constructor Summary
BLOBFileValue()
           
 
Method Summary
abstract  void delete(boolean pruneEmptyParentDirs)
          Deletes the persistent resource backing this BLOBFileValue.
abstract  void discard()
          Frees temporarily allocated resources such as temporary file, buffer, etc.
abstract  boolean equals(Object obj)
          
abstract  long getLength()
          Returns the length of this BLOBFileValue.
abstract  InputStream getStream()
          Returns an InputStream representation of this value.
abstract  int hashCode()
          
abstract  boolean isImmutable()
          Checks if this object is immutable.
abstract  boolean isSmall()
          Check if the value is small (contains a low number of bytes) and should be stored inline.
 void spool(OutputStream out)
           
abstract  String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BLOBFileValue

public BLOBFileValue()
Method Detail

getStream

public abstract InputStream getStream()
                               throws RepositoryException
Returns an InputStream representation of this value.

Returns:
An InputStream representation of this value.
Throws:
RepositoryException

getLength

public abstract long getLength()
Returns the length of this BLOBFileValue.

Returns:
The length, in bytes, of this BLOBFileValue, or -1L if the length can't be determined.
Throws:
IOException

discard

public abstract void discard()
Frees temporarily allocated resources such as temporary file, buffer, etc. If this BLOBFileValue is backed by a persistent resource calling this method will have no effect.

See Also:
#delete(), delete(boolean)

delete

public abstract void delete(boolean pruneEmptyParentDirs)
Deletes the persistent resource backing this BLOBFileValue.

Parameters:
pruneEmptyParentDirs - if true, empty parent directories will automatically be deleted

isImmutable

public abstract boolean isImmutable()
Checks if this object is immutable. Immutable objects can not change and can safely copied.

Returns:
true if the object is immutable

equals

public abstract boolean equals(Object obj)

Overrides:
equals in class Object

toString

public abstract String toString()

Overrides:
toString in class Object

spool

public void spool(OutputStream out)
           throws RepositoryException,
                  IOException
Throws:
RepositoryException
IOException

hashCode

public abstract int hashCode()

Overrides:
hashCode in class Object

isSmall

public abstract boolean isSmall()
Check if the value is small (contains a low number of bytes) and should be stored inline.

Returns:
true if the value is small


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.