Package com.axemble.vdoc.sdk.impl
Class SnapshotAttachment
java.lang.Object
com.axemble.vdoc.sdk.impl.AbstractElement
com.axemble.vdoc.sdk.impl.PortalElement
com.axemble.vdoc.sdk.impl.SnapshotAttachment
- All Implemented Interfaces:
IAttachment
,IElement
,IProtocolSupport
,IUriSupport
,Serializable
- Author:
- vlygeros
- See Also:
-
Field Summary
Fields inherited from class com.axemble.vdoc.sdk.impl.PortalElement
path, storageKey
Fields inherited from class com.axemble.vdoc.sdk.impl.AbstractElement
module
-
Constructor Summary
ConstructorDescriptionSnapshotAttachment
(IModule module, com.axemble.webdrive.om.ContentSnapshot contentSnapshot) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
void
getContent
(File file) Retrieves the attachment content as a file object.void
getContent
(OutputStream outputStream) Retrieves the attachment content as a stream .Get the stream to read the content Look out to close the stream when finishedgetName()
Gets the native object underneath.Get the stream to writte the content Look out to close the stream when finishedlong
getSize()
getURI()
Gets the URI of the object supporting this interfaceboolean
void
setContent
(byte[] content) Allow to set the content of the attachment by passing an array of bytes.void
setContent
(File file) Allow to set the content of the attachment by passing aFile
object.void
setContent
(InputStream inputStream) Allow to set the content of the attachment by passing aInputStream
object.void
Allow to set the system name of the attachmentMethods inherited from class com.axemble.vdoc.sdk.impl.PortalElement
equals, getId, getPath, getProtocolURI, getProtocolURI, hashCode, replaceBackSlash, replaceSlash, save, setId
Methods inherited from class com.axemble.vdoc.sdk.impl.AbstractElement
getModule
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.axemble.vdoc.sdk.interfaces.IElement
getId, getModule, getPath, save
Methods inherited from interface com.axemble.vdoc.sdk.supports.IProtocolSupport
getProtocolURI, getProtocolURI
-
Constructor Details
-
SnapshotAttachment
- Parameters:
module
-
-
-
Method Details
-
getContent
Description copied from interface:IAttachment
Retrieves the attachment content as a file object.- Specified by:
getContent
in interfaceIAttachment
- Parameters:
file
- The file object to write to.
-
getContent
Description copied from interface:IAttachment
Retrieves the attachment content as a stream .- Specified by:
getContent
in interfaceIAttachment
- Parameters:
outputStream
- The output stream to write to.
-
getContent
public byte[] getContent()- Specified by:
getContent
in interfaceIAttachment
-
getCreatedDate
- Specified by:
getCreatedDate
in interfaceIAttachment
- Returns:
- The created date
-
getModifiedDate
- Specified by:
getModifiedDate
in interfaceIAttachment
- Returns:
- The last modified date
-
getName
- Specified by:
getName
in interfaceIAttachment
- Returns:
- The system name of the attachment
-
getShortName
- Specified by:
getShortName
in interfaceIAttachment
- Returns:
- The short name of the attachment
-
getSize
public long getSize()- Specified by:
getSize
in interfaceIAttachment
- Returns:
- The size of the attachment
-
setContent
Description copied from interface:IAttachment
Allow to set the content of the attachment by passing aFile
object.- Specified by:
setContent
in interfaceIAttachment
- Parameters:
file
- The file object
-
setContent
Description copied from interface:IAttachment
Allow to set the content of the attachment by passing aInputStream
object.- Specified by:
setContent
in interfaceIAttachment
- Parameters:
inputStream
- The input stream.
-
setContent
public void setContent(byte[] content) Description copied from interface:IAttachment
Allow to set the content of the attachment by passing an array of bytes.- Specified by:
setContent
in interfaceIAttachment
- Parameters:
content
- The array of bytes.
-
setName
Description copied from interface:IAttachment
Allow to set the system name of the attachment- Specified by:
setName
in interfaceIAttachment
- Parameters:
name
- The name to set
-
getNativeObject
Description copied from interface:IElement
Gets the native object underneath.- Specified by:
getNativeObject
in interfaceIElement
- Returns:
- an object.
-
getURI
Description copied from interface:IUriSupport
Gets the URI of the object supporting this interface- Specified by:
getURI
in interfaceIUriSupport
- Returns:
- A String object.
-
getInputStream
Description copied from interface:IAttachment
Get the stream to read the content Look out to close the stream when finished- Specified by:
getInputStream
in interfaceIAttachment
- Returns:
- InputStream the stream to read
- Throws:
IOException
-
getOutputStream
Description copied from interface:IAttachment
Get the stream to writte the content Look out to close the stream when finished- Specified by:
getOutputStream
in interfaceIAttachment
- Returns:
- OutputStream the stream to writte
- Throws:
IOException
-
isReadable
public boolean isReadable()- Specified by:
isReadable
in interfaceIAttachment
-