com.pdfunit.tools

## Class UtilityBase

- java.lang.Object
- - com.pdfunit.tools.UtilityBase

- Direct Known Subclasses:
    ConvertUnicodeToHex, ExtractBookmarks, ExtractEmbeddedFiles, ExtractFieldInfo, ExtractFontInfo, ExtractImages, ExtractJavaScript, ExtractNamedDestinations, ExtractSignatureInfo, ExtractXFAData, ExtractXMPData, ExtractZugferdData, RenderPdfPageRegionToImage, RenderPdfToImages

      @DoNotObfuscate
      public abstract class UtilityBase
      extends java.lang.Object

  Base class for extraction programs.
  Since:
    2016.05
  Author:
    Carsten Siedentop, February 2016

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `EMPTY_STRING`
    `static java.lang.String` | `OUTPUT_PATH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UtilityBase()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `appendTrailingSlash(java.lang.String dir)`
    `protected void` | `assertIsDirectory(java.lang.String dir)`
    `protected abstract void` | `checkArguments(java.lang.String[] args)`
    `protected void` | `checkArguments(java.lang.String[] args, int expectedNumberOfArguments)`
    `protected java.lang.String` | `createSourceBaseName(java.lang.String srcName)`
    `protected java.io.Writer` | `createUTF8Writer(java.lang.String targetName)`
    `protected boolean` | `isDirectory(java.lang.String dir)`
    `protected abstract void` | `parseArguments(java.lang.String[] args)`
    `static void` | `showUsage(java.lang.String usageMessage)`
    `protected void` | `writeToFile(java.lang.String content, java.io.Writer out)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### OUTPUT_PATH

          public static final java.lang.String OUTPUT_PATH

      See Also:
        Constant Field Values

    - #### EMPTY_STRING

          protected static final java.lang.String EMPTY_STRING

  - ### Constructor Detail

    - #### UtilityBase

          public UtilityBase()

  - ### Method Detail

    - #### checkArguments

          protected abstract void checkArguments(java.lang.String[] args)
                                          throws PDFUnitInvalidProgramInvokeException

      Throws:
        `PDFUnitInvalidProgramInvokeException`

    - #### parseArguments

          protected abstract void parseArguments(java.lang.String[] args)
                                          throws PDFUnitInvalidProgramInvokeException

      Throws:
        `PDFUnitInvalidProgramInvokeException`

    - #### isDirectory

          protected boolean isDirectory(java.lang.String dir)

    - #### writeToFile

          protected void writeToFile(java.lang.String content,
                         java.io.Writer out)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### createUTF8Writer

          protected java.io.Writer createUTF8Writer(java.lang.String targetName)
                                             throws java.io.FileNotFoundException,
                                                    java.io.UnsupportedEncodingException

      Throws:
        `java.io.FileNotFoundException`
        `java.io.UnsupportedEncodingException`

    - #### checkArguments

          protected void checkArguments(java.lang.String[] args,
                            int expectedNumberOfArguments)
                                 throws PDFUnitInvalidProgramInvokeException

      Throws:
        `PDFUnitInvalidProgramInvokeException`

    - #### createSourceBaseName

          protected java.lang.String createSourceBaseName(java.lang.String srcName)

    - #### appendTrailingSlash

          protected java.lang.String appendTrailingSlash(java.lang.String dir)

    - #### assertIsDirectory

          protected void assertIsDirectory(java.lang.String dir)
                                    throws PDFUnitInvalidProgramInvokeException

      Throws:
        `PDFUnitInvalidProgramInvokeException`

    - #### showUsage

          public static void showUsage(java.lang.String usageMessage)

Copyright (C) PDFUnit.com. See here for license.