| Modifier and Type | Class and Description |
|---|---|
| public static class | FileUtil.Pipe
A pipe when run reads from an input stream to an output stream, optionally sleeping between reads. |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileFilter | ALL
accept all files |
| public static final FileFilter | |
| public static final File | DEFAULT_PARENT
default parent directory File when a file has a null parent |
| public static final FileFilter | |
| pack-priv static final String | |
| pack-priv static final int[] | |
| private static final boolean | |
| public static final List | SOURCE_SUFFIXES
unmodifiable List of String source file suffixes (including leading ".") |
| public static final FileFilter |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static int | |
| public static int | Returns: the total number of files copiedselect files with this suffix - select all if null or empty fromSuffix, String replace fromSuffix with toSuffix in the destination file name - ignored if null or empty, appended to name if
fromSuffix is null or empty toSuffix)Recursively copy files in fromDir (with any fromSuffix) to toDir, replacing fromSuffix with toSuffix if any. |
| public static int | Returns: the total number of files copiedselect files with this suffix - select all if null or empty fromSuffix, final String replace fromSuffix with toSuffix in the destination file name - ignored if null or empty, appended to name if
fromSuffix is null or empty toSuffix, final FileFilter delegate)Recursively copy files in fromDir (with any fromSuffix) to toDir, replacing fromSuffix with toSuffix if any. |
| public static void | |
| public static File[] | copyFiles(File
an existing, readable directory containing relativePaths files srcDir, String[] a set of paths relative to srcDir to readable File to copy relativePaths, File an existing, writable directory to copy files to destDir)Copy files from source dir into destination directory, creating any needed directories. |
| public static void | |
| public static void | |
| public static void | |
| public static void | copyValidFiles(File
the File to copy (readable, non-null file) fromFile, File the File to copy to (non-null, parent dir exists) toFile)Copy file to file. |
| public static int | Returns: the total number of files deletedRecursively delete the contents of dir, but not the dir itself |
| public static int | Returns: the total number of files deletedRecursively delete some contents of dir, but not the dir itself. |
| public static int | Returns: the total number of files deletedthe File directory (if a file, the the file is deleted) dir, FileFilter filter, boolean deleteEmptyDirs)Recursively delete some contents of dir, but not the dir itself. |
| public static File | Returns: the File path of the writable parent directorythe File path whose parent should be writable path)Ensure that the parent directory to path can be written. |
| public static String | fileToClassName(File
the File of the base directory (prefix of classFile) basedir, File the File of the class to extract the name for classFile)Extract the name of a class from the path to its file. |
| public static String | Returns: String with absolute paths to entries in order, delimited with infixthe File[] to flatten - may be null or empty files, String the String delimiter internally between entries (if null, then use File.pathSeparator). (alias to
infix)flatten(getAbsolutePaths(files), infix)Render a set of files to String as a path by getting absolute paths of each and delimiting with infix. |
| public static String | |
| public static String[] | |
| public static File[] | Returns: File[] with same length as pathsthe non-null File base directory for File to create with paths basedir, String[] the String[] of paths to create paths)Convert String[] paths to File[] as offset of base directory |
| public static File[] | Returns: File[] with same length as pathsthe non-null File base directory for File to create with paths basedir, String[] the String[] of paths to create paths, String[] the String[] of suffixes to limit sources to - ignored if null suffixes)Convert String[] paths to File[] as offset of base directory |
| public static File | Returns: null if not found, or valid File otherwisethe String[] of paths to check. paths)Get best File for the first-readable path in input paths, treating entries prefixed "sp:" as system property keys. |
| public static File | |
| public static File | Returns: File of the best-available paththe File to get the best File for (not null) file)Render as best file, canonical or absolute. |
| public static String | Returns: String of the best-available paththe File to get the path for (not null) file)Render as best path, canonical or absolute. |
| public static URL | |
| public static URL[] | |
| public static String[] | |
| public static String[] | |
| public static InputStream | |
| public static File | Returns: File of an existing new temp dir, or null if unable to createthe preferred (simple) name of the directory - may be null. name)Make a new temporary directory in the same directory that the system uses for temporary files, or if that files, in the current directory. |
| public static boolean | |
| public static boolean | |
| private static boolean | |
| public static boolean | |
| public static List | Returns: List of String of the form file:line for each found entry (never null, might be empty)the String text to seek in the file sought, List<String> the List of String paths to the source files sources, boolean if false, only list first match in file listAll, PrintStream the PrintStream to print any errors to (one per line) (use null to silently ignore errors) errorSink)Do line-based search for literal text in source files, returning file:line where found. |
| public static String | Returns: String error if any, or add String entries to sinkthe String text to seek in the file sought, String the String of paths to the source files sourcePath, boolean if false, only list first match in file listAll, List<String> the List of String entries of the form {sourcePath}:line:column sink)Do line-based search for literal text in source file, returning line where found as a String in the form {sourcePath}:line:column submitted to the collecting parameter sink. |
| public static List | Returns: List of File objectsRecursively list .class files in specified directory |
| private static void | |
| public static String[] | |
| public static File[] | Returns: ArrayList with String paths of File under srcDir (relative to srcDir)Recursively list files in srcDir. |
| private static void | |
| private static void | |
| public static List | |
| public static File | Returns: a File dir that exists with parentDir as the parent file or nulla File for the parent (writable) parent, String a prefix for the child directory child)Make a new child directory of parent |
| public static BufferedOutputStream | |
| private static File | |
| public static String | Returns: "" if null or normalized path otherwisethe File with the path to normalize file, File the File for the prefix of the file to normalize - ignored if null basedir)Normalize path for comparisons by rendering absolute, clipping basedir prefix, trimming and changing '\\' to '/' |
| public static String | Returns: "" if null or normalized path otherwiseNormalize path for comparisons by rendering absolute trimming and changing '\\' to '/' |
| pack-priv static String | |
| public static byte[] | |
| public static byte[] | |
| public static List | |
| public static String | |
| public static boolean[] | |
| public static int[] | |
| public static String[] | |
| public static boolean | Returns: true if succeeded without 100 interruptsthe File[] of files to inspect for last modified times (this ignores null or empty files array and null or
non-existing components of files array) files)Sleep until after the last last-modified stamp from the files. |
| public static int | Returns: 0 if file has no source suffix or the length of the suffix otherwise
|
| public static int | |
| public static void | |
| public static void | |
| public static void | |
| private static String | |
| public static String | weakNormalize(String path)
Weakly normalize path for comparisons by trimming and changing '\\' to '/' |
| public static String | Returns: String null on no error, error otherwisethe File to write (not null) file, String the String to write (use "" if null) contents)Write contents to file, returning null on success or error message otherwise. |
| public static void | |
| public static void | |
| public static void | |
| public static int | |
| public static int |