org.indi.objects
Class Blob

java.lang.Object
  extended by org.indi.objects.Object<Object>
      extended by org.indi.objects.Element
          extended by org.indi.objects.Blob
All Implemented Interfaces:
java.io.Serializable

public class Blob
extends Element

a BLOB (binary large object) as transferred by the indi protocol

Author:
Dirk Hünniger
See Also:
Serialized Form

Field Summary
protected  java.lang.String format
          the format of the BLOB usually the extension of a file format
protected  long size
          the length of the BLOB in bytes
 
Fields inherited from class org.indi.objects.Element
label, name, value
 
Fields inherited from class org.indi.objects.Object
children, message, transferType
 
Constructor Summary
Blob(java.lang.String name, java.lang.String label)
          class constuctor
Blob(java.lang.String name, java.lang.String format, long size, java.lang.String value)
          class constructor
 
Method Summary
 java.lang.String getStartTag(TransferType type)
          Get the opening XML tag for the element
protected  java.lang.String getType()
           
 java.lang.String getValue(TransferType type)
          get the value of the indielement
 void setValue(java.io.File file)
          Set the data to be transferred using a given file as input
 void setValue(java.io.InputStream inputStream, java.lang.String format)
           
 void setValue(java.lang.String data)
          Set the data to be tranferred by the BLOB (format is set to the empty string)
 void setValue(java.lang.String data, java.lang.String format)
          Set the data to be tranferred by the BLOB
 
Methods inherited from class org.indi.objects.Element
getEndTag, getName, getXML, hashCode, oEquals
 
Methods inherited from class org.indi.objects.Object
equals, getChildren, getMessage, getTransferType, getXML, setTransferType, treeEquals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

format

protected java.lang.String format
the format of the BLOB usually the extension of a file format


size

protected long size
the length of the BLOB in bytes

Constructor Detail

Blob

public Blob(java.lang.String name,
            java.lang.String label)
class constuctor

Parameters:
name - the name of the BLOB
label - the label of the BLOB (to be used for display in the GUI)

Blob

public Blob(java.lang.String name,
            java.lang.String format,
            long size,
            java.lang.String value)
class constructor

Parameters:
name - the name of the BLOB
format - the format of the BLOB usually the extension of a file format
size - the length of the BLOB in bytes
value - the data carryed by the BLOB
Method Detail

getValue

public java.lang.String getValue(TransferType type)
Description copied from class: Element
get the value of the indielement

Overrides:
getValue in class Element
Parameters:
type - the way the blob has benn transferred.
Returns:
the data carryed by the BLOB

getStartTag

public java.lang.String getStartTag(TransferType type)
Description copied from class: Element
Get the opening XML tag for the element

Overrides:
getStartTag in class Element
Parameters:
type - the transfertype to be used
Returns:
the generated opening tag
See Also:
Element.getStartTag(org.indi.objects.TransferType)

setValue

public void setValue(java.lang.String data,
                     java.lang.String format)
Set the data to be tranferred by the BLOB

Parameters:
data - the data to be transferred
format - the format of the data, ususually the extension of a file format

setValue

public void setValue(java.io.File file)
Set the data to be transferred using a given file as input

Parameters:
file - the file to be used as input

setValue

public void setValue(java.io.InputStream inputStream,
                     java.lang.String format)

setValue

public void setValue(java.lang.String data)
Set the data to be tranferred by the BLOB (format is set to the empty string)

Overrides:
setValue in class Element
Parameters:
data - the data to be transferred

getType

protected java.lang.String getType()
Specified by:
getType in class Element
Returns:
the type of the indi element


Copyright © 2008. All Rights Reserved.