com.fatwire.assetapi.data
Class BlobObjectImpl

java.lang.Object
  extended by com.fatwire.assetapi.data.BlobObjectImpl
All Implemented Interfaces:
BlobObject

public class BlobObjectImpl
extends java.lang.Object
implements BlobObject

Implementation class for BlobObject


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.fatwire.assetapi.data.BlobObject
BlobObject.BlobAddress
 
Field Summary
protected static org.apache.commons.logging.Log _logger
           
 
Constructor Summary
BlobObjectImpl(java.lang.String filename, java.lang.String folder, byte[] bytes)
          Constructs a BlobObject with filename, folder and binary
BlobObjectImpl(java.lang.String filename, java.lang.String folder, byte[] bytes, BlobObject.BlobAddress blobAddress)
          Constructs a BlobObject with filename, folder, binary and a blobAddress; this is primarily used for creating BlobObject from existing Content Server objects
BlobObjectImpl(java.lang.String filename, java.lang.String folder, byte[] bytes, BlobObject.BlobAddress blobAddress, boolean keepBytes)
          Constructs a BlobObject with filename, folder, binary and a blobAddress; this is primarily used for creating BlobObject from existing Content Server objects
 
Method Summary
 java.io.InputStream getBinaryStream()
          retrieves the binary related to this Binary Object
 BlobObject.BlobAddress getBlobAddress()
          Returns the db address for a given blob object.
 java.lang.String getFilename()
          Gets the filename related to this binary object
 java.lang.String getFoldername()
          Gets the foler name of the binary Object; the value returned is the absolute path of where the blob/binary is stored
 void setBinaryData(byte[] bytes)
          sets the binary related to this Binary Object
 void setFilename(java.lang.String filename)
          Sets the filename related to this binary object
 void setFoldername(java.lang.String foldername)
          Sets the foler name of the binary Object; the value returned is the absolute path of where the blob/binary is stored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected static final org.apache.commons.logging.Log _logger
Constructor Detail

BlobObjectImpl

public BlobObjectImpl(java.lang.String filename,
                      java.lang.String folder,
                      byte[] bytes)
Constructs a BlobObject with filename, folder and binary

Parameters:
filename - the name of the blob
folder - the folder of the blob - we normally expect full path name
bytes - the binary of the blob

BlobObjectImpl

public BlobObjectImpl(java.lang.String filename,
                      java.lang.String folder,
                      byte[] bytes,
                      BlobObject.BlobAddress blobAddress)
Constructs a BlobObject with filename, folder, binary and a blobAddress; this is primarily used for creating BlobObject from existing Content Server objects

Parameters:
filename - the name of the blob
folder - the folder of the blob - we normally expect full path name
bytes - the binary of the blob
blobAddress - the blobAddress where the blob is residing in content server

BlobObjectImpl

public BlobObjectImpl(java.lang.String filename,
                      java.lang.String folder,
                      byte[] bytes,
                      BlobObject.BlobAddress blobAddress,
                      boolean keepBytes)
Constructs a BlobObject with filename, folder, binary and a blobAddress; this is primarily used for creating BlobObject from existing Content Server objects

Parameters:
filename - the name of the blob
folder - the folder of the blob - we normally expect full path name
bytes - the binary of the blob
blobAddress - the blobAddress where the blob is residing in content server
keepBytes - instructs Content Server whether we should keep the binary passed in permanent in memory or they could be removed when memory is low; true indicates that binary will always be kept in memory. CAUTION: keeping too much binary in memory would potentially cause out of memory errors
Method Detail

getFilename

public java.lang.String getFilename()
Description copied from interface: BlobObject
Gets the filename related to this binary object

Specified by:
getFilename in interface BlobObject
Returns:
String the filename

getFoldername

public java.lang.String getFoldername()
Description copied from interface: BlobObject
Gets the foler name of the binary Object; the value returned is the absolute path of where the blob/binary is stored

Specified by:
getFoldername in interface BlobObject
Returns:
String folder name

getBinaryStream

public java.io.InputStream getBinaryStream()
Description copied from interface: BlobObject
retrieves the binary related to this Binary Object

Specified by:
getBinaryStream in interface BlobObject
Returns:
InputStream of the binary

getBlobAddress

public BlobObject.BlobAddress getBlobAddress()
Description copied from interface: BlobObject
Returns the db address for a given blob object. For basic asset, it usually points to a row in the primary table of the asset type. For flex asset, it is a row in MungoBlob table

Specified by:
getBlobAddress in interface BlobObject
Returns:
the table name, identifier(normally id) and column name of where the blob object is hold in database

setBinaryData

public void setBinaryData(byte[] bytes)
Description copied from interface: BlobObject
sets the binary related to this Binary Object

Specified by:
setBinaryData in interface BlobObject
Parameters:
bytes - the binary

setFilename

public void setFilename(java.lang.String filename)
Description copied from interface: BlobObject
Sets the filename related to this binary object

Specified by:
setFilename in interface BlobObject
Parameters:
filename - the fileName

setFoldername

public void setFoldername(java.lang.String foldername)
Description copied from interface: BlobObject
Sets the foler name of the binary Object; the value returned is the absolute path of where the blob/binary is stored

Specified by:
setFoldername in interface BlobObject
Parameters:
foldername - folder name


Copyright (c) 2003 - 2011 FatWire Corporation All Rights Reserved.