Package net.thevpc.naru.ext.tools.fs
Class FileToolHelper
java.lang.Object
net.thevpc.naru.ext.tools.fs.FileToolHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfileAppend(NaruTask task, String path, String content, Boolean dry) static StringfileCreate(NaruTask task, String path, String content, Boolean overwrite) static Stringstatic StringfileEditSearchReplace(NaruTask task, String path, String search, String replace, Long occurrence, Boolean dry) static StringfileGrep(NaruTask task, String path, String pattern, Boolean regex, Boolean caseSensitive, Integer contextLines0, Integer maxMatches0) static Stringstatic Stringstatic Stringstatic StringfolderFind(NaruTask task, String path, String pattern, Boolean regex, Boolean caseSensitive, Integer contextLines, Integer maxMatches, Integer maxFiles, Boolean recursive, String includeGlob, String excludeGlob, String modified_after0, String modified_before0) static StringfolderFindFirst(NaruTask task, String path, String includeGlob, Boolean recursive) First file underpathwhose NAME matchesinclude(a glob), ornullwhen none / when the path is not a readable directory.static String
-
Field Details
-
MAX_PREVIEW_CHARS
public static final int MAX_PREVIEW_CHARS- See Also:
-
DEFAULT_CONTEXT
public static final int DEFAULT_CONTEXT- See Also:
-
DEFAULT_MAX_MATCHES
public static final int DEFAULT_MAX_MATCHES- See Also:
-
DEFAULT_MAX_LINES
public static final int DEFAULT_MAX_LINES- See Also:
-
MAX_OUTPUT_CHARS
public static final int MAX_OUTPUT_CHARS- See Also:
-
MAX_TOTAL_MATCHES
public static final int MAX_TOTAL_MATCHES- See Also:
-
DEFAULT_MAX_FILES
public static final int DEFAULT_MAX_FILES- See Also:
-
BINARY_EXTENSIONS
-
-
Constructor Details
-
FileToolHelper
public FileToolHelper()
-
-
Method Details
-
filesDiff
-
fileAppend
-
fileEdit
-
fileEditSearchReplace
-
fileCreate
-
fileGrep
-
fileRead
-
fileWrite
-
folderFind
-
folderFindFirst
public static String folderFindFirst(NaruTask task, String path, String includeGlob, Boolean recursive) First file underpathwhose NAME matchesinclude(a glob), ornullwhen none / when the path is not a readable directory. The returned path is RELATIVE to the searched root when it lies inside it (absolute otherwise), so scripts can hand it straight to maven/java invoked with the project directory as cwd (mvn -o -q -f pom.xml,java -cp proj/target/classes ...). -
snippet
-