public class AttachmentValue extends Object implements Cloneable, Serializable
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.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AttachmentValue() |
AttachmentValue(byte[] loc) |
AttachmentValue(String filePath) |
AttachmentValue(String name,
byte[] loc) |
AttachmentValue(String name,
String filePath) |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int AR_LOC_FILENAME
AR_LOC_FILENAME
specifies that the contents of the blob should be returned/set
in a file.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.public AttachmentValue()
public AttachmentValue(byte[] loc)
public AttachmentValue(String name, byte[] loc)
public AttachmentValue(String filePath) throws IOException
IOException
public AttachmentValue(String name, String filePath) throws IOException
IOException
public String getName()
public void setName(String name)
public long getOriginalSize()
public void setOriginalSize(long size)
size
- public long getCompressedSize()
public void setCompressedSize(long size)
size
- public String getValueFileName()
public byte[] getContent()
public byte[] getValue()
public void setValue(byte[] content)
content
- the content to setpublic void setValue(String filePath) throws IOException
filePath
- set the contentIOException
public void setLocationType(int type)
public void setFilePath(String filePath)
public String toString()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public int getLocationType()
public int hashCode()
public boolean equals(Object obj)
? Copyright 2013 BMC Software, Inc.