Package org.fugerit.java.tool.encoding
Class CharsetCorrect
- java.lang.Object
-
- org.fugerit.java.tool.ToolHandlerHelper
-
- org.fugerit.java.tool.encoding.CharsetCorrect
-
- All Implemented Interfaces:
ToolHandler
public class CharsetCorrect extends ToolHandlerHelper
Tool to correct character encoding.
- Author:
- Fugerit
-
-
Field Summary
Fields Modifier and Type Field Description static String
PARAM_APPEND_INFO_AS_COMMENT
This Arg should be set to '1' in case you want to add comment to corrected filesstatic String
PARAM_FOLDER_FILTER
Arg for a name filter to apply on the recursionstatic String
PARAM_FOLDER_RECURSE
Arg for a folder to recurse onstatic String
PARAM_INPUT_FILE
Arg for input filestatic String
PARAM_OUTPUT_FILE
Arg for output file (default to input-file)static String
PARAM_REPORT_FILE
Path to a report file for the whole operationstatic String
PARAM_SOURCE_CHARSET
Arg for Source charsetstatic String
PARAM_SOURCE_CHARSET_DEFAULT
static String
PARAM_TARGET_CHARSET
Arg for Target charsetstatic String
PARAM_TARGET_CHARSET_DEFAULT
-
Fields inherited from class org.fugerit.java.tool.ToolHandlerHelper
ARG_EXTRA_JAR, EXIT_KO_DEFAULT, LOG_PARAM_LITERAL, logger
-
Fields inherited from interface org.fugerit.java.tool.ToolHandler
EXIT_OK
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
correct(Properties params)
The main method of this Class.int
handleWorker(Properties params)
Handler worker method.-
Methods inherited from class org.fugerit.java.tool.ToolHandlerHelper
getClassLoader, getHelp, handle
-
-
-
-
Field Detail
-
PARAM_INPUT_FILE
public static final String PARAM_INPUT_FILE
Arg for input file- See Also:
- Constant Field Values
-
PARAM_OUTPUT_FILE
public static final String PARAM_OUTPUT_FILE
Arg for output file (default to input-file)- See Also:
- Constant Field Values
-
PARAM_FOLDER_RECURSE
public static final String PARAM_FOLDER_RECURSE
Arg for a folder to recurse on- See Also:
- Constant Field Values
-
PARAM_FOLDER_FILTER
public static final String PARAM_FOLDER_FILTER
Arg for a name filter to apply on the recursion- See Also:
- Constant Field Values
-
PARAM_APPEND_INFO_AS_COMMENT
public static final String PARAM_APPEND_INFO_AS_COMMENT
This Arg should be set to '1' in case you want to add comment to corrected files- See Also:
- Constant Field Values
-
PARAM_REPORT_FILE
public static final String PARAM_REPORT_FILE
Path to a report file for the whole operation- See Also:
- Constant Field Values
-
PARAM_TARGET_CHARSET
public static final String PARAM_TARGET_CHARSET
Arg for Target charset- See Also:
- Constant Field Values
-
PARAM_TARGET_CHARSET_DEFAULT
public static final String PARAM_TARGET_CHARSET_DEFAULT
- See Also:
- Constant Field Values
-
PARAM_SOURCE_CHARSET
public static final String PARAM_SOURCE_CHARSET
Arg for Source charset- See Also:
- Constant Field Values
-
PARAM_SOURCE_CHARSET_DEFAULT
public static final String PARAM_SOURCE_CHARSET_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
correct
public static void correct(Properties params) throws RunToolException
The main method of this Class.
- Parameters:
params
- the arguments- Throws:
RunToolException
- if issues arise.
-
handleWorker
public int handleWorker(Properties params) throws RunToolException
Description copied from class:ToolHandlerHelper
Handler worker method.
- Specified by:
handleWorker
in classToolHandlerHelper
- Parameters:
params
- ths params for the tool- Returns:
- exit code (0 is all ok)
- Throws:
RunToolException
- issues if problems arise
-
-