Interface IAttachment

All Superinterfaces:
IElement, IProtocolSupport, IUriSupport, Serializable
All Known Implementing Classes:
PortalAttachment, SnapshotAttachment

public interface IAttachment extends IElement, IUriSupport, IProtocolSupport
The IAttachment interface represents any attachment in the system. It allows to manipulate attachment in a simpler manner.
Since:
1.0, 15/04/2008
Author:
vlygeros
See Also:
  • Method Details

    • getName

      String getName()
      Returns:
      The system name of the attachment
    • setName

      void setName(String name)
      Allow to set the system name of the attachment
      Parameters:
      name - The name to set
    • getShortName

      String getShortName()
      Returns:
      The short name of the attachment
    • getCreatedDate

      Date getCreatedDate()
      Returns:
      The created date
    • getModifiedDate

      Date getModifiedDate()
      Returns:
      The last modified date
    • getSize

      long getSize()
      Returns:
      The size of the attachment
    • setContent

      void setContent(File file)
      Allow to set the content of the attachment by passing a File object.
      Parameters:
      file - The file object
    • setContent

      void setContent(InputStream readStream)
      Allow to set the content of the attachment by passing a InputStream object.
      Parameters:
      readStream - The input stream.
    • setContent

      void setContent(byte[] content)
      Allow to set the content of the attachment by passing an array of bytes.
      Parameters:
      content - The array of bytes.
    • getContent

      void getContent(File file)
      Retrieves the attachment content as a file object.
      Parameters:
      file - The file object to write to.
    • getContent

      void getContent(OutputStream outputStream)
      Retrieves the attachment content as a stream .
      Parameters:
      outputStream - The output stream to write to.
    • getContent

      byte[] getContent()
    • getInputStream

      InputStream getInputStream() throws IOException
      Get the stream to read the content Look out to close the stream when finished
      Returns:
      InputStream the stream to read
      Throws:
      IOException
    • getOutputStream

      OutputStream getOutputStream() throws IOException
      Get the stream to writte the content Look out to close the stream when finished
      Returns:
      OutputStream the stream to writte
      Throws:
      IOException
    • isReadable

      boolean isReadable()