Class GutenbergFileFilter

  • All Implemented Interfaces:
    FileFilter

    public class GutenbergFileFilter
    extends java.lang.Object
    implements FileFilter
    Extract the contents of an ancient word processor file (might be Word Perfect) and convert to a text format. Currently supported formats are plain text, HTML, or RTF. These are not exact duplicates, but they are close approximations. RTF format is suitable for conversion to other word processors.

    To choose export format, use the appropriately named select method.

    Date created: Dec 18, 2008 9:09:21 AM

    • Constructor Summary

      Constructors 
      Constructor Description
      GutenbergFileFilter()
      Constructor for GutenbergFileFilter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] filter​(FileEntry fileEntry)
      Process the given FileEntry and return a byte array with filtered data.
      java.lang.String getSuggestedFileName​(FileEntry fileEntry)
      Give suggested file name.
      protected void handleReturn​(java.io.PrintWriter printWriter)
      Deal with carriage-return.
      protected void handleTranslation​(java.lang.String raw, java.io.PrintWriter output, int rendering)
      Transform text into desired destination format
      boolean isHtmlRendering()
      Indicates if this is an HTML rendering.
      boolean isRtfRendering()
      Indicates if this is an RTF rendering.
      boolean isTextRendering()
      Indicates if this is a text rendering.
      void selectHtmlRendering()
      Selects the HTML rendering engine.
      void selectRtfRendering()
      Selects the RTF rendering engine.
      void selectTextRendering()
      Selects the text rendering engine.
      protected void setRendering​(int rendering)
      Set the rendering method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GutenbergFileFilter

        public GutenbergFileFilter()
        Constructor for GutenbergFileFilter.
    • Method Detail

      • handleTranslation

        protected void handleTranslation​(java.lang.String raw,
                                         java.io.PrintWriter output,
                                         int rendering)
        Transform text into desired destination format
      • handleReturn

        protected void handleReturn​(java.io.PrintWriter printWriter)
        Deal with carriage-return.
      • setRendering

        protected void setRendering​(int rendering)
        Set the rendering method.
      • isTextRendering

        public boolean isTextRendering()
        Indicates if this is a text rendering.
      • isHtmlRendering

        public boolean isHtmlRendering()
        Indicates if this is an HTML rendering.
      • isRtfRendering

        public boolean isRtfRendering()
        Indicates if this is an RTF rendering.
      • selectTextRendering

        public void selectTextRendering()
        Selects the text rendering engine.
      • selectHtmlRendering

        public void selectHtmlRendering()
        Selects the HTML rendering engine.
      • selectRtfRendering

        public void selectRtfRendering()
        Selects the RTF rendering engine.