# ExtractFilter

The ExtractFilter program demonstrates the File Extraction interface. The `FilterTest` sample program demonstrates the functionality of the Filtering interface. See FilterTest.

The `ExtractFilter` program demonstrates the following functionality:

- opens a document
- extracts subfiles from a document
- repeats subfile extraction until all subfiles are extracted
- enables you to specify the command-line options listed in the following table

To run `ExtractFilter`

1. Add the location of the `javaapi\KeyView.jar` file, the `javaapi\sample` directory, and the Filter `bin` directory to the `CLASSPATH` environment variable.

2. Type the following:

       java -Djava.library.path=bin_directory ExtractFilter [options] bin_directory input_file output_dir

   where,

   `bin_directory` is the path to the Filter `bin` directory.

   `options` is one or more of the options listed in the following table.

   `input_file` is the path and file name of the source file.

   `output_dir` is the path of the folder to write the output files to. This folder does not have to exist.

Options for ExtractFilter Sample Program

Option | Description
--- | ---
`-extonly` | Extracts the subfiles from a source file but does not filter the files after extraction.
`-ext-fbody` | Extracts the formatted version of the message body (HTML or RTF) from mail files when possible.
`-source-cs charset` | Sets the character set of the source file. `charset` is a character set defined in the Filter class. See Coded Character Sets.
`-target-cs charset` | Sets the character set of the output file. `charset` is a character set defined in the Filter class. See Coded Character Sets.
`-little-end` | Sets the byte order for Unicode text to Little Endian.
`-is` | Sets the input as a stream. The default is file.
`-os` | Sets the output as a stream. The default is file.
`-ip` | Runs file extraction in the same process as the calling application (in process). See Run Filter In Process.
`-open-user username` | Specifies the user name used to open a protected PST file.
`-open-pass password` | Specifies the password used to open a protected PST file.
`-open-idfile idfile` | Specifies the user ID file used to open a protected PST file.
`-open-createroot` | Creates a root directory on which a hierarchy can be based. See Create a Root Node.
`-ext-nodir` | Specifies the subfile directory structure is not created.
`-ext-noheader` | Excludes mail header information from extracted message body text file. See Exclude Metadata from the Extracted Text File.
`-meta outfile` | Extracts default mail metadata and writes it to a file. See Extract Mail Metadata.

_FT_HTML5_bannerTitle.htm