Class SnapshotAttachment

All Implemented Interfaces:
IAttachment, IElement, IProtocolSupport, IUriSupport, Serializable

public class SnapshotAttachment extends PortalElement implements IAttachment
Author:
vlygeros
See Also:
  • Constructor Details

    • SnapshotAttachment

      public SnapshotAttachment(IModule module, com.axemble.webdrive.om.ContentSnapshot contentSnapshot)
      Parameters:
      module -
  • Method Details

    • getContent

      public void getContent(File file)
      Description copied from interface: IAttachment
      Retrieves the attachment content as a file object.
      Specified by:
      getContent in interface IAttachment
      Parameters:
      file - The file object to write to.
    • getContent

      public void getContent(OutputStream outputStream)
      Description copied from interface: IAttachment
      Retrieves the attachment content as a stream .
      Specified by:
      getContent in interface IAttachment
      Parameters:
      outputStream - The output stream to write to.
    • getContent

      public byte[] getContent()
      Specified by:
      getContent in interface IAttachment
    • getCreatedDate

      public Date getCreatedDate()
      Specified by:
      getCreatedDate in interface IAttachment
      Returns:
      The created date
    • getModifiedDate

      public Date getModifiedDate()
      Specified by:
      getModifiedDate in interface IAttachment
      Returns:
      The last modified date
    • getName

      public String getName()
      Specified by:
      getName in interface IAttachment
      Returns:
      The system name of the attachment
    • getShortName

      public String getShortName()
      Specified by:
      getShortName in interface IAttachment
      Returns:
      The short name of the attachment
    • getSize

      public long getSize()
      Specified by:
      getSize in interface IAttachment
      Returns:
      The size of the attachment
    • setContent

      public void setContent(File file)
      Description copied from interface: IAttachment
      Allow to set the content of the attachment by passing a File object.
      Specified by:
      setContent in interface IAttachment
      Parameters:
      file - The file object
    • setContent

      public void setContent(InputStream inputStream)
      Description copied from interface: IAttachment
      Allow to set the content of the attachment by passing a InputStream object.
      Specified by:
      setContent in interface IAttachment
      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 interface IAttachment
      Parameters:
      content - The array of bytes.
    • setName

      public void setName(String name)
      Description copied from interface: IAttachment
      Allow to set the system name of the attachment
      Specified by:
      setName in interface IAttachment
      Parameters:
      name - The name to set
    • getNativeObject

      public Object getNativeObject()
      Description copied from interface: IElement
      Gets the native object underneath.
      Specified by:
      getNativeObject in interface IElement
      Returns:
      an object.
    • getURI

      public String getURI()
      Description copied from interface: IUriSupport
      Gets the URI of the object supporting this interface
      Specified by:
      getURI in interface IUriSupport
      Returns:
      A String object.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from interface: IAttachment
      Get the stream to read the content Look out to close the stream when finished
      Specified by:
      getInputStream in interface IAttachment
      Returns:
      InputStream the stream to read
      Throws:
      IOException
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Description copied from interface: IAttachment
      Get the stream to writte the content Look out to close the stream when finished
      Specified by:
      getOutputStream in interface IAttachment
      Returns:
      OutputStream the stream to writte
      Throws:
      IOException
    • isReadable

      public boolean isReadable()
      Specified by:
      isReadable in interface IAttachment