com.ibm.openpages.api.resource

## Interface IDocument

- All Superinterfaces:
    IGRCObject, IResource

      public interface IDocument
      extends IGRCObject

  Represents a single version of a document stored in the system. The IDocument can have content data associated with it.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.InputStream` | `getContent()` Returns the file content for this document.
    `long` | `getContentLength()` Returns the length of the content associated with this document.
    `IFileTypeDefinition` | `getFileTypeDefinition()` Returns the file type definition.
    `void` | `setContent(byte[] content)` Sets the file content for this document.
    `void` | `setContent(byte[] content, IFileTypeDefinition fileTypeDefinition)` Sets the file content for this document.
    `void` | `setContent(java.io.InputStream contentStream, long contentLength)` Sets the file content for this document.
    `void` | `setContent(java.io.InputStream contentStream, long contentLength, IFileTypeDefinition fileTypeDefinition)` Sets the file content for this document.

    - ### Methods inherited from interface com.ibm.openpages.api.resource.IGRCObject

      `addChildren, addParents, getActiveWorkflowIds, getCalcLogs, getChildren, getField, getField, getFields, getParents, getPrimaryParent, getType, hasCalcInQueue, hasCalcLogs, isCheckedOut, isLocked, setPrimaryParent, setPrimaryParent`

    - ### Methods inherited from interface com.ibm.openpages.api.resource.IResource

      `getCreationDate, getCreator, getDescription, getId, getLastModifiedBy, getModifiedDate, getName, getParentFolder, getPath, isFolder, setDescription, setName, setParentFolder`

- - ### Method Detail

    - #### getContentLength

          long getContentLength()

      Returns the length of the content associated with this document.
      Returns:
        the length of the content associated with this document. If no document is associated, a length of zero is returned.

    - #### getFileTypeDefinition

          IFileTypeDefinition getFileTypeDefinition()

      Returns the file type definition.
      Returns:
        the file type definition

    - #### getContent

          java.io.InputStream getContent()

      Returns the file content for this document.
      Returns:
        the file content for this document if one exists, otherwise an empty input stream

    - #### setContent

          void setContent(java.io.InputStream contentStream,
                          long contentLength)

      Sets the file content for this document.
      Parameters:
        `contentLength` - the length content in bytes
        `content` - the content for this document

    - #### setContent

          void setContent(java.io.InputStream contentStream,
                          long contentLength,
                          IFileTypeDefinition fileTypeDefinition)

      Sets the file content for this document.
      Parameters:
        `contentStream` - the file content for this document
        `contentLength` - the length content in bytes
        `fileTypeDefinition` - the file type definition for this content

    - #### setContent

          void setContent(byte[] content)

      Sets the file content for this document.
      Parameters:
        `content` - the file content for this document

    - #### setContent

          void setContent(byte[] content,
                          IFileTypeDefinition fileTypeDefinition)

      Sets the file content for this document.
      Parameters:
        `content` - the file content for this document
        `fileTypeDefinition` - the file type definition for this content

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2022. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.