Class FileDocument

java.lang.Object
org.apache.rat.document.impl.FileDocument
All Implemented Interfaces:
Document

public class FileDocument extends Object implements Document
Document wrapping a file of undetermined composition.
  • Constructor Details

    • FileDocument

      public FileDocument(File file)
  • Method Details

    • isComposite

      public boolean isComposite()
      Description copied from interface: Document
      Is this a composite document?
      Specified by:
      isComposite in interface Document
      Returns:
      true if composite, false otherwise
    • reader

      public Reader reader() throws IOException
      Description copied from interface: Document
      Reads the contents of this document.
      Specified by:
      reader in interface Document
      Returns:
      Reader not null
      Throws:
      IOException - if this document cannot be read
      CompositeDocumentException - if this document can only be read as a composite archive
    • getName

      public String getName()
      Specified by:
      getName in interface Document
      Returns:
      the name of the current document.
    • getMetaData

      public MetaData getMetaData()
      Description copied from interface: Document
      Gets data describing this resource.
      Specified by:
      getMetaData in interface Document
      Returns:
      not null
    • inputStream

      public InputStream inputStream() throws IOException
      Description copied from interface: Document
      Streams the document's contents.
      Specified by:
      inputStream in interface Document
      Returns:
      not null
      Throws:
      IOException - when stream could not be opened
    • toString

      public String toString()
      Representations suitable for logging.
      Overrides:
      toString in class Object
      Returns:
      a String representation of this object.