public class FileFunction
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
FileFunction.AddFileToList |
(package private) static class |
FileFunction.FileCheckPath
Not ready yet.
|
Constructor and Description |
---|
FileFunction() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addFileToList(java.io.File dir,
java.lang.String sPath,
FileFunction.AddFileToList listFiles)
Add files.
|
static java.lang.CharSequence |
getLinesFile(java.io.File file,
int startLine,
java.lang.String startString,
int nrofLines,
boolean tillEmptyLine,
boolean tillLesserIndent,
java.lang.String terminateString,
boolean onStartIndent,
boolean removeIndent)
Returns some lines from a file, especially for documentation of sources.
|
public static boolean addFileToList(java.io.File dir, java.lang.String sPath, FileFunction.AddFileToList listFiles)
dir
- may be null, a directory as base for sPath.sPath
- path may contain wildcard for path and file. May use backslash or slash.listFiles
- Container to get the files.public static java.lang.CharSequence getLinesFile(java.io.File file, int startLine, java.lang.String startString, int nrofLines, boolean tillEmptyLine, boolean tillLesserIndent, java.lang.String terminateString, boolean onStartIndent, boolean removeIndent)
file
- from this filestartLine
- at least from this start line, first line of file is 1startString
- if given, from the line which contains this String after Start line. Typically an identifier. It needs few calculation time to test each line.nrofLines
- either this nr of lines, set to greater value for the other conditions.tillEmptyLine
- true then till any empty line is found (with spaces or only nl)tillLesserIndent
- true then till a line is found which has lesser indentation as the found start line.
In this case the return text does not contain the indentation. Indentation should be written only with spaces or only with tabs.terminateString
- if not null then till a found String inclusively this string, usual a ";" or "}"onStartIndent
- true then the terminateString is expected only on the same indent as the start.