org.apache.jackrabbit.core.value
Class BLOBInTempFile

java.lang.Object
  extended by org.apache.jackrabbit.core.value.BLOBFileValue
      extended by org.apache.jackrabbit.core.value.BLOBInTempFile

public class BLOBInTempFile
extends BLOBFileValue

Represents binary data which is stored in a temporary file.


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

Method Detail

delete

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

Specified by:
delete in class BLOBFileValue
Parameters:
pruneEmptyParentDirs - if true, empty parent directories will automatically be deleted

discard

public 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.

Specified by:
discard in class BLOBFileValue
See Also:
BLOBFileValue.delete(boolean)

isImmutable

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

Specified by:
isImmutable in class BLOBFileValue
Returns:
true if the object is immutable

getLength

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

Specified by:
getLength in class BLOBFileValue
Returns:
The length, in bytes, of this BLOBFileValue, or -1L if the length can't be determined.

getStream

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

Specified by:
getStream in class BLOBFileValue
Returns:
An InputStream representation of this value.
Throws:
IllegalStateException
RepositoryException

toString

public String toString()

Specified by:
toString in class BLOBFileValue

equals

public boolean equals(Object obj)

Specified by:
equals in class BLOBFileValue

hashCode

public int hashCode()
Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.

Specified by:
hashCode in class BLOBFileValue
Returns:
always zero
See Also:
Object.hashCode()

isSmall

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

Specified by:
isSmall in class BLOBFileValue
Returns:
true if the value is small


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