|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.datamodel.StoredAttachment
public class StoredAttachment
Placeholder for an attachment where the content is stored in some storage service instead of in-memory.
All methods of this class that access the attachment content just throw an AttachmentException.
TODO: Add subclasses that are able to deliver the attachment content from the respective storage.
| Field Summary | |
|---|---|
static long |
SIZE_UNKNOWN
result of size() if size is not known. |
| Constructor Summary | |
|---|---|
StoredAttachment(java.lang.String name)
create instance with unknown size. |
|
StoredAttachment(java.lang.String name,
long size)
create instance. |
|
| Method Summary | |
|---|---|
void |
dispose()
called to denote that this attachment is not needed anymore and used resources can be released. |
byte[] |
getAsBytes()
get attachment content as a byte array. |
byte[] |
getAsBytes(int length)
get start of attachment content as byte[]. |
java.io.InputStream |
getAsStream()
get attachment content for streaming. |
java.lang.String |
getName()
|
long |
size()
get size of attachments. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long SIZE_UNKNOWN
size() if size is not known.
| Constructor Detail |
|---|
public StoredAttachment(java.lang.String name)
public StoredAttachment(java.lang.String name,
long size)
| Method Detail |
|---|
public java.lang.String getName()
getName in interface Attachmentpublic long size()
Attachment
size in interface Attachmentpublic byte[] getAsBytes()
Attachment
getAsBytes in interface Attachmentpublic byte[] getAsBytes(int length)
Attachment
getAsBytes in interface Attachmentpublic java.io.InputStream getAsStream()
Attachment
getAsStream in interface Attachmentpublic void dispose()
Attachment
dispose in interface Attachmentpublic java.lang.String toString()
toString in class java.lang.Object
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||