|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfiletools.fileconverttools.SimpleFileConverter
filetools.fileconverttools.MatlabHelpfileConverter
public class MatlabHelpfileConverter
Implementation of IFileConverter which converts a helpfile line by line. Each "file:" in a link is replaced by "" by searching the regex 'href\s*=\s*"file:'
Field Summary | |
---|---|
private static java.lang.String[] |
TO_CONVERT
keeps the searched regex and its replacement - very simple in this application |
Fields inherited from class filetools.fileconverttools.SimpleFileConverter |
---|
BLOCKSIZE |
Constructor Summary | |
---|---|
MatlabHelpfileConverter()
|
Method Summary | |
---|---|
protected void |
convertFile(java.io.File fileToConvert)
Converts a file by reading, converting and storing its contents line by line. |
protected void |
convertFile(java.io.File inputFile,
java.io.File outputFile)
Converts a file line by line. |
private java.lang.String |
convertString(java.lang.String stringToConvert)
Converts a given String by searching for an regex and replacing each of its occurrences by a given expression |
protected boolean |
isDirToConvert(java.lang.String dir)
The contents of all subdirs should be converted |
protected boolean |
isFileToConvert(java.lang.String filename)
htm and html files will be converted |
protected boolean |
isFileToCopy(java.lang.String filename)
All files should be copied |
static void |
main(java.lang.String[] args)
|
Methods inherited from class filetools.fileconverttools.SimpleFileConverter |
---|
convertInDir, copyFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String[] TO_CONVERT
Constructor Detail |
---|
public MatlabHelpfileConverter()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- should contain the base directoryprotected boolean isDirToConvert(java.lang.String dir)
isDirToConvert
in class SimpleFileConverter
dir
- path of the directory (relative or absolute)
SimpleFileConverter.isDirToConvert(String)
protected boolean isFileToConvert(java.lang.String filename)
isFileToConvert
in class SimpleFileConverter
filename
- path of the file
SimpleFileConverter.isFileToConvert(String)
protected boolean isFileToCopy(java.lang.String filename)
isFileToCopy
in class SimpleFileConverter
filename
- path of the file
SimpleFileConverter.isFileToCopy(String)
protected void convertFile(java.io.File inputFile, java.io.File outputFile)
convertFile
in class SimpleFileConverter
inputFile
- file to convertoutputFile
- converted fileSimpleFileConverter.convertFile(File, File)
private java.lang.String convertString(java.lang.String stringToConvert)
stringToConvert
- String before conversion
protected void convertFile(java.io.File fileToConvert)
fileToConvert
- File which is used as input and output.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |