AR System Java API

com.bmc.arsys.api
Class AttachmentValue

java.lang.Object
  extended by com.bmc.arsys.api.AttachmentValue
All Implemented Interfaces:
Serializable, Cloneable

public class AttachmentValue
extends Object
implements Cloneable, Serializable

The AttachmentValue class is used to get/set the information about attachment fields. This class represents the attachment, or binary large object (blob), stored for the attachment field with the indicated ID on the specified server. The data is returned/set either in a buffer or a file, depending on the type of location.

See Also:
Serialized Form

Field Summary
static int AR_LOC_BUFFER
          AR_LOC_BUFFER specifies that the contents of the blob should be returned/set in a data buffer.
static int AR_LOC_FILENAME
          AR_LOC_FILENAME specifies that the contents of the blob should be returned/set in a file.
 
Constructor Summary
AttachmentValue()
           
AttachmentValue(byte[] loc)
           
AttachmentValue(String filePath)
           
AttachmentValue(String name, byte[] loc)
           
AttachmentValue(String name, String filePath)
           
 
Method Summary
 Object clone()
          Clone implementation that returns an Object with data cloned from self.
 boolean equals(Object obj)
          Use this method for checking equality between the current object and the provided one.
 long getCompressedSize()
          Returns compressed size of attachment.
 byte[] getContent()
           
 int getLocationType()
           
 String getName()
          Returns name of the attachment.
 long getOriginalSize()
          Returns the original size of attachment.
 byte[] getValue()
           
 String getValueFileName()
          get the file path to this attachment.
 int hashCode()
          Returns the hash code value for this instance of the current class.
 void setCompressedSize(long size)
          Set the compressed size of the attachment
 void setFilePath(String filePath)
           
 void setLocationType(int type)
           
 void setName(String name)
          Sets the name of the attachment.
 void setOriginalSize(long size)
          Sets the Orginal size
 void setValue(byte[] content)
          sets the specified bytes to the attachment
 void setValue(String filePath)
          read bytes from the file, and set the bytes to the attachment.
 String toString()
          Returns a string description of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AR_LOC_FILENAME

public static final int AR_LOC_FILENAME
AR_LOC_FILENAME specifies that the contents of the blob should be returned/set in a file.

See Also:
Constant Field Values

AR_LOC_BUFFER

public static final int AR_LOC_BUFFER
AR_LOC_BUFFER specifies that the contents of the blob should be returned/set in a data buffer.

See Also:
Constant Field Values
Constructor Detail

AttachmentValue

public AttachmentValue()

AttachmentValue

public AttachmentValue(byte[] loc)

AttachmentValue

public AttachmentValue(String name,
                       byte[] loc)

AttachmentValue

public AttachmentValue(String filePath)
                throws IOException
Throws:
IOException

AttachmentValue

public AttachmentValue(String name,
                       String filePath)
                throws IOException
Throws:
IOException
Method Detail

getName

public String getName()
Returns name of the attachment.


setName

public void setName(String name)
Sets the name of the attachment.


getOriginalSize

public long getOriginalSize()
Returns the original size of attachment.


setOriginalSize

public void setOriginalSize(long size)
Sets the Orginal size

Parameters:
size -

getCompressedSize

public long getCompressedSize()
Returns compressed size of attachment.


setCompressedSize

public void setCompressedSize(long size)
Set the compressed size of the attachment

Parameters:
size -

getValueFileName

public String getValueFileName()
get the file path to this attachment. If the path is not available, then just return the name of the attachment.


getContent

public byte[] getContent()
Returns:
the byte content of this attachment

getValue

public byte[] getValue()
Returns:
the byte content of this attachment

setValue

public void setValue(byte[] content)
sets the specified bytes to the attachment

Parameters:
content - the content to set

setValue

public void setValue(String filePath)
              throws IOException
read bytes from the file, and set the bytes to the attachment.

Parameters:
filePath - set the content
Throws:
IOException

setLocationType

public void setLocationType(int type)

setFilePath

public void setFilePath(String filePath)

toString

public String toString()
Returns a string description of the object.

Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Clone implementation that returns an Object with data cloned from self.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getLocationType

public int getLocationType()
Returns:
the locationType

hashCode

public int hashCode()
Returns the hash code value for this instance of the current class. This method is supported as required by the general contract of Object.hashCode, for the benefit of hash tables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class Object
Returns:
returns the hash code for this instance

equals

public boolean equals(Object obj)
Use this method for checking equality between the current object and the provided one. The result is true only if the argument is not null, is of the same type and represents the same content.

Overrides:
equals in class Object
Parameters:
obj - the object that we are comparing to
Returns:
returns a boolean that tells if the two objects equal

AR System Java API

© Copyright 2006, 2007 BMC Software, Inc.