info.monitorenter.cpdetector
Class CodepageProcessor

java.lang.Object
  extended by info.monitorenter.cpdetector.ACmdLineArgsInheritor
      extended by info.monitorenter.cpdetector.CodepageProcessor

public class CodepageProcessor
extends ACmdLineArgsInheritor

An executable command line interface for batch processing files with cpdetector.

It works on a CodepageDetectorProxy to detect the charset encoding of documents and uses that information to sort the given documents in a taxonomy tree that contains the codepage name at the root folders. Optionally the codepages may be tried to transform to a specified target codepage.

Usage

Two alternatives:
  1. Deflated classfiles (not contained in a jar):
  2. jarfile:
  3. You will see a usage - text that informs about the parameters and their effect.

Author:
Achim Westermann

Field Summary
protected  File collectionRoot
          The root folder (directory) under which all files for the collection are found.
protected  CodepageDetectorProxy detector
          The codepage detection proxy that will be used.
 
Constructor Summary
CodepageProcessor()
           
 
Method Summary
protected  void describe()
           
static void main(String[] args)
           
 void parseArgs(String[] cmdLineArgs)
           This method has to be called initially by the code using this instance in order to configure.
 void process()
           
protected  void usage()
          Prints out the usage of the command line interface.
protected  void verifyFiles()
          All three Files are validated if null, existant and the right type (directory vs.
 
Methods inherited from class info.monitorenter.cpdetector.ACmdLineArgsInheritor
addCmdLineOption, getParsedCmdLineOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collectionRoot

protected File collectionRoot
The root folder (directory) under which all files for the collection are found.


detector

protected CodepageDetectorProxy detector
The codepage detection proxy that will be used. Is optionally configured by argument \"-c\".

Constructor Detail

CodepageProcessor

public CodepageProcessor()
Method Detail

parseArgs

public void parseArgs(String[] cmdLineArgs)
               throws Exception
Description copied from class: ACmdLineArgsInheritor

This method has to be called initially by the code using this instance in order to configure.

Every subclass has to call super.parseArgs(cmdLineArgs) and then retrieve the options needed from the returned CmdLineParser!

Overrides:
parseArgs in class ACmdLineArgsInheritor
Throws:
Exception

process

public final void process()
                   throws Exception
Throws:
Exception

verifyFiles

protected void verifyFiles()
                    throws IllegalArgumentException
All three Files are validated if null, existant and the right type (directory vs. file).

Throws:
Exception - Sth. does not seem to be valid.
IllegalArgumentException

describe

protected void describe()

usage

protected void usage()
Prints out the usage of the command line interface.

Specified by:
usage in class ACmdLineArgsInheritor

main

public static void main(String[] args)


Copyleft ㊢ 2003-2004 MPL 1.1, All Rights Footloose.