public class FileUtil extends FileUtilRt
File
.FileUtilRt.RepeatableIOOperation<T,E extends java.lang.Throwable>, FileUtilRt.SymlinkResolver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASYNC_DELETE_EXTENSION |
static <any> |
FILE_HASHING_STRATEGY |
static <any> |
PATH_CHAR_SEQUENCE_HASHING_STRATEGY |
static <any> |
PATH_HASHING_STRATEGY |
static int |
REGEX_PATTERN_FLAGS |
ALL_DIRECTORIES, ALL_FILES, BUFFER, LARGE_FILE_PREVIEW_SIZE, LARGE_FOR_CONTENT_LOADING, MEGABYTE, THREAD_LOCAL_BUFFER_LENGTH
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static byte [] |
adaptiveLoadBytes(java.io.InputStream stream) |
static char [] |
adaptiveLoadText(java.io.Reader reader) |
static void |
appendToFile(java.io.File file,
java.lang.String text) |
static java.util.concurrent.Future<java.lang.Void> |
asyncDelete(java.util.Collection<? extends java.io.File> files) |
static java.util.concurrent.Future<java.lang.Void> |
asyncDelete(java.io.File file) |
static boolean |
canExecute(java.io.File file) |
static boolean |
canWrite(java.lang.String path) |
static void |
collectMatchedFiles(java.io.File root,
java.util.regex.Pattern pattern,
java.util.List<? super java.io.File> outFiles) |
static int |
compareFiles(java.io.File file1,
java.io.File file2) |
static int |
comparePaths(java.lang.String path1,
java.lang.String path2) |
static boolean |
containsWindowsShortName(java.lang.String path) |
static java.lang.String |
convertAntToRegexp(java.lang.String antPattern) |
static java.lang.String |
convertAntToRegexp(java.lang.String antPattern,
boolean ignoreStartingSlash) |
static void |
copy(java.io.File fromFile,
java.io.File toFile) |
static void |
copy(java.io.InputStream inputStream,
int maxSize,
java.io.OutputStream outputStream) |
static void |
copy(java.io.InputStream inputStream,
long maxSize,
java.io.OutputStream outputStream) |
static void |
copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream) |
static void |
copyContent(java.io.File fromFile,
java.io.File toFile) |
static void |
copyDir(java.io.File fromDir,
java.io.File toDir) |
static void |
copyDir(java.io.File fromDir,
java.io.File toDir,
boolean copySystemFiles) |
static void |
copyDir(java.io.File fromDir,
java.io.File toDir,
java.io.FileFilter filter) |
static void |
copyDirContent(java.io.File fromDir,
java.io.File toDir)
Copies content of
fromDir to toDir . |
static void |
copyFileOrDir(java.io.File from,
java.io.File to) |
static void |
copyFileOrDir(java.io.File from,
java.io.File to,
boolean isDir) |
static boolean |
createDirectory(java.io.File path) |
static boolean |
createIfDoesntExist(java.io.File file) |
static boolean |
createParentDirs(java.io.File file) |
static java.lang.String |
createSequentFileName(java.io.File aParentFolder,
java.lang.String aFilePrefix,
java.lang.String aExtension) |
static java.lang.String |
createSequentFileName(java.io.File aParentFolder,
java.lang.String aFilePrefix,
java.lang.String aExtension,
Condition<? super java.io.File> condition) |
static java.io.File |
createTempDirectory(java.io.File dir,
java.lang.String prefix,
java.lang.String suffix) |
static java.io.File |
createTempDirectory(java.io.File dir,
java.lang.String prefix,
java.lang.String suffix,
boolean deleteOnExit) |
static java.io.File |
createTempDirectory(java.lang.String prefix,
java.lang.String suffix) |
static java.io.File |
createTempDirectory(java.lang.String prefix,
java.lang.String suffix,
boolean deleteOnExit) |
static java.io.File |
createTempFile(java.io.File dir,
java.lang.String prefix,
java.lang.String suffix) |
static java.io.File |
createTempFile(java.io.File dir,
java.lang.String prefix,
java.lang.String suffix,
boolean create) |
static java.io.File |
createTempFile(java.io.File dir,
java.lang.String prefix,
java.lang.String suffix,
boolean create,
boolean deleteOnExit) |
static java.io.File |
createTempFile(java.lang.String prefix,
java.lang.String suffix) |
static java.io.File |
createTempFile(java.lang.String prefix,
java.lang.String suffix,
boolean deleteOnExit) |
static boolean |
delete(java.io.File file) |
static void |
delete(java.nio.file.Path path) |
static boolean |
deleteWithRenaming(java.io.File file) |
static boolean |
ensureCanCreateFile(java.io.File file) |
static void |
ensureExists(java.io.File dir) |
static boolean |
exists(java.lang.String path) |
static java.lang.String |
expandUserHome(java.lang.String path) |
static int |
fileHashCode(java.io.File file) |
static boolean |
filesEqual(java.io.File file1,
java.io.File file2) |
static JBTreeTraverser<java.io.File> |
fileTraverser(java.io.File root) |
static java.io.File |
findAncestor(java.io.File f1,
java.io.File f2) |
static java.lang.String |
findFileInProvidedPath(java.lang.String providedPath,
java.lang.String... fileNames)
Returns empty string for empty path.
|
static java.util.List<java.io.File> |
findFilesByMask(java.util.regex.Pattern pattern,
java.io.File dir) |
static java.util.List<java.io.File> |
findFilesOrDirsByMask(java.util.regex.Pattern pattern,
java.io.File dir) |
static java.io.File |
findFirstThatExist(java.lang.String... paths) |
static java.io.File |
findSequentFile(java.io.File parentFolder,
java.lang.String filePrefix,
java.lang.String extension,
Condition<? super java.io.File> condition)
Checks sequentially files with names filePrefix.extension, filePrefix1.extension, e.t.c
and returns the first file which conforms to the provided condition.
|
static java.io.File |
findSequentNonexistentFile(java.io.File parentFolder,
java.lang.String filePrefix,
java.lang.String extension) |
static java.io.File |
generateRandomTemporaryPath() |
static java.lang.String |
getExtension(java.lang.String fileName)
Deprecated.
this method returns extension converted to lower case, this may not be correct for case-sensitive FS.
Use
FileUtilRt.getExtension(String) instead to get the unchanged extension.
If you need to check whether a file has a specified extension use FileUtilRt.extensionEquals(String, String) |
static java.lang.String |
getLocationRelativeToUserHome(java.lang.String path) |
static java.lang.String |
getLocationRelativeToUserHome(java.lang.String path,
boolean unixOnly) |
static java.lang.String |
getNameWithoutExtension(java.io.File file) |
static java.lang.String |
getNameWithoutExtension(java.lang.String name) |
static java.io.File |
getParentFile(java.io.File file) |
static java.lang.String |
getRelativePath(java.io.File base,
java.io.File file)
Gets the relative path from the
base to the file regardless existence or the type of the base . |
static java.lang.String |
getRelativePath(java.lang.String basePath,
java.lang.String filePath,
char separator) |
static java.lang.String |
getRelativePath(java.lang.String basePath,
java.lang.String filePath,
char separator,
boolean caseSensitive) |
static java.lang.String |
getTempDirectory() |
static java.lang.String |
getUrl(java.io.File file) |
static boolean |
isAbsolute(java.lang.String path) |
static boolean |
isAbsolutePlatformIndependent(java.lang.String path)
Deprecated.
does not support UNC paths; consider using
PathUtil or NIO2 instead |
static boolean |
isAncestor(java.io.File ancestor,
java.io.File file,
boolean strict)
Check if the
ancestor is an ancestor of file . |
static boolean |
isAncestor(java.lang.String ancestor,
java.lang.String file,
boolean strict) |
static ThreeState |
isAncestorThreeState(java.lang.String ancestor,
java.lang.String file,
boolean strict)
Checks if the
ancestor is an ancestor of the file , and if it is an immediate parent or not. |
static boolean |
isFilePathAcceptable(java.io.File root,
java.io.FileFilter fileFilter) |
static boolean |
isFileSystemCaseSensitive(java.lang.String path) |
static boolean |
isHashBangLine(java.lang.CharSequence firstCharsIfText,
java.lang.String marker) |
static boolean |
isUnixAbsolutePath(java.lang.String path)
Deprecated.
ambiguous w.r.t. to normalized UNC paths; consider using
PathUtil or NIO2 instead |
static boolean |
isWindowsAbsolutePath(java.lang.String path)
Deprecated.
does not support UNC paths; consider using
PathUtil or NIO2 instead |
static java.lang.String |
join(java.lang.String... parts) |
static byte [] |
loadBytes(java.io.InputStream stream) |
static byte [] |
loadBytes(java.io.InputStream stream,
int length) |
static java.lang.String |
loadFile(java.io.File file) |
static java.lang.String |
loadFile(java.io.File file,
boolean convertLineSeparators) |
static java.lang.String |
loadFile(java.io.File file,
java.nio.charset.Charset encoding) |
static java.lang.String |
loadFile(java.io.File file,
java.lang.String encoding) |
static java.lang.String |
loadFile(java.io.File file,
java.lang.String encoding,
boolean convertLineSeparators) |
static byte [] |
loadFileBytes(java.io.File file) |
static char [] |
loadFileText(java.io.File file) |
static char [] |
loadFileText(java.io.File file,
java.lang.String encoding) |
static byte [] |
loadFirstAndClose(java.io.InputStream stream,
int maxLength) |
static java.util.List<java.lang.String> |
loadLines(java.io.BufferedReader reader) |
static java.util.List<java.lang.String> |
loadLines(java.io.File file) |
static java.util.List<java.lang.String> |
loadLines(java.io.File file,
java.lang.String encoding) |
static java.util.List<java.lang.String> |
loadLines(java.lang.String path) |
static java.util.List<java.lang.String> |
loadLines(java.lang.String path,
java.lang.String encoding) |
static char [] |
loadText(java.io.Reader reader,
int length) |
static java.lang.String |
loadTextAndClose(java.io.InputStream stream) |
static java.lang.String |
loadTextAndClose(java.io.Reader reader) |
static boolean |
moveDirWithContent(java.io.File fromDir,
java.io.File toDir) |
static boolean |
namesEqual(java.lang.String name1,
java.lang.String name2)
optimized version of pathsEqual - it only compares pure names, without file separators
|
static java.lang.String |
normalize(java.lang.String path)
converts back slashes to forward slashes
removes double slashes inside the path, e.g.
|
static java.io.File [] |
notNullize(java.io.File [] files) |
static java.io.File [] |
notNullize(java.io.File [] files,
java.io.File [] defaultFiles) |
static int |
pathHashCode(java.lang.String path) |
static boolean |
pathsEqual(java.lang.String path1,
java.lang.String path2) |
static boolean |
processFilesRecursively(java.io.File root,
Processor<? super java.io.File> processor) |
static boolean |
processFilesRecursively(java.io.File root,
Processor<? super java.io.File> processor,
Processor<? super java.io.File> directoryFilter)
Deprecated.
|
static void |
rename(java.io.File source,
java.io.File target) |
static boolean |
rename(java.io.File source,
java.lang.String newName) |
static void |
resetCanonicalTempPathCache(java.lang.String tempPath) |
static java.lang.String |
resolveShortWindowsName(java.lang.String path) |
static java.lang.String |
sanitizeFileName(java.lang.String name) |
static java.lang.String |
sanitizeFileName(java.lang.String name,
boolean strict) |
static java.lang.String |
sanitizeFileName(java.lang.String name,
boolean strict,
java.lang.String replacement) |
static void |
setExecutable(java.io.File file) |
static void |
setExecutableAttribute(java.lang.String path,
boolean executableFlag)
Deprecated.
use
setExecutable(File) or File.setExecutable(boolean, boolean) |
static void |
setReadOnlyAttribute(java.lang.String path,
boolean readOnlyFlag) |
static java.util.List<java.lang.String> |
splitPath(java.lang.String path) |
static java.util.List<java.lang.String> |
splitPath(java.lang.String path,
char separatorChar) |
static boolean |
startsWith(java.lang.String path,
java.lang.String start) |
static boolean |
startsWith(java.lang.String path,
java.lang.String start,
boolean caseSensitive) |
static boolean |
startsWith(java.lang.String path,
java.lang.String start,
boolean caseSensitive,
boolean strict) |
static java.lang.String |
toCanonicalPath(java.lang.String path)
Converts given path to canonical representation by eliminating '.'s, traversing '..'s, and omitting duplicate separators.
|
static java.lang.String |
toCanonicalPath(java.lang.String path,
boolean resolveSymlinksIfNecessary)
When relative ../ parts do not escape outside of symlinks, the links are not expanded.
That is, in the best-case scenario the original non-expanded path is preserved. Otherwise, returns a fully resolved path using File.getCanonicalPath() .Consider the following case: |
static java.lang.String |
toCanonicalPath(java.lang.String path,
char separatorChar) |
static java.lang.String |
toCanonicalUriPath(java.lang.String path) |
static java.lang.String |
toSystemDependentName(java.lang.String aFileName) |
static java.lang.String |
toSystemIndependentName(java.lang.String aFileName) |
static java.lang.String |
unquote(java.lang.String urlString) |
static boolean |
visitFiles(java.io.File root,
Processor<? super java.io.File> processor) |
static void |
writeToFile(java.io.File file,
byte [] text) |
static void |
writeToFile(java.io.File file,
byte [] text,
boolean append) |
static void |
writeToFile(java.io.File file,
byte [] text,
int off,
int len) |
static void |
writeToFile(java.io.File file,
java.lang.String text) |
static void |
writeToFile(java.io.File file,
java.lang.String text,
boolean append) |
createIfNotExists, deleteFile, doIOOperation, extensionEquals, getExtension, getExtension, getNameWithoutExtension, getThreadLocalBuffer, getUserContentLoadLimit, getUserFileSizeLimit, isJarOrZip, isJarOrZip, isTooLarge, loadFileText, toCanonicalPath, toCanonicalPath, toSystemDependentName
public static final java.lang.String ASYNC_DELETE_EXTENSION
public static final int REGEX_PATTERN_FLAGS
public static final <any> PATH_HASHING_STRATEGY
public static final <any> PATH_CHAR_SEQUENCE_HASHING_STRATEGY
public static final <any> FILE_HASHING_STRATEGY
public static java.lang.String join(java.lang.String... parts)
public static java.lang.String getRelativePath(java.io.File base, java.io.File file)
base
to the file
regardless existence or the type of the base
.
NOTE: if the file(not directory) passed as the base
the result can not be used as a relative path from the base
parent directory to the file
base
- the basefile
- the filebase
to the file
or null
public static java.lang.String getRelativePath(java.lang.String basePath, java.lang.String filePath, char separator)
public static java.lang.String getRelativePath(java.lang.String basePath, java.lang.String filePath, char separator, boolean caseSensitive)
public static boolean isAbsolute(java.lang.String path)
public static boolean exists(java.lang.String path)
public static boolean isAncestor(java.io.File ancestor, java.io.File file, boolean strict)
ancestor
is an ancestor of file
.ancestor
- supposed ancestor.file
- supposed descendant.strict
- if false
then this method returns true
if ancestor
equals to file
.true
if ancestor
is parent of file
; false
otherwise.public static boolean isAncestor(java.lang.String ancestor, java.lang.String file, boolean strict)
public static ThreeState isAncestorThreeState(java.lang.String ancestor, java.lang.String file, boolean strict)
ancestor
is an ancestor of the file
, and if it is an immediate parent or not.ancestor
- supposed ancestor.file
- supposed descendant.strict
- if false
, the file can be ancestor of itself,
i.e. the method returns ThreeState.YES
if ancestor
equals to file
.ThreeState.YES
if ancestor is an immediate parent of the file,
ThreeState.UNSURE
if ancestor is not immediate parent of the file,
ThreeState.NO
if ancestor is not a parent of the file at all.public static boolean startsWith(java.lang.String path, java.lang.String start)
public static boolean startsWith(java.lang.String path, java.lang.String start, boolean caseSensitive)
public static boolean startsWith(java.lang.String path, java.lang.String start, boolean caseSensitive, boolean strict)
public static java.io.File findAncestor(java.io.File f1, java.io.File f2)
public static java.io.File getParentFile(java.io.File file)
public static byte [] loadFileBytes(java.io.File file) throws java.io.IOException
java.io.IOException
public static byte [] loadFirstAndClose(java.io.InputStream stream, int maxLength) throws java.io.IOException
java.io.IOException
public static java.lang.String loadTextAndClose(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public static java.lang.String loadTextAndClose(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static char [] adaptiveLoadText(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static byte [] adaptiveLoadBytes(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public static java.util.concurrent.Future<java.lang.Void> asyncDelete(java.io.File file)
public static java.util.concurrent.Future<java.lang.Void> asyncDelete(java.util.Collection<? extends java.io.File> files)
public static boolean delete(java.io.File file)
public static void delete(java.nio.file.Path path) throws java.io.IOException
java.io.IOException
public static boolean createParentDirs(java.io.File file)
public static boolean createDirectory(java.io.File path)
public static boolean createIfDoesntExist(java.io.File file)
public static boolean ensureCanCreateFile(java.io.File file)
public static void copy(java.io.File fromFile, java.io.File toFile) throws java.io.IOException
java.io.IOException
public static void copyContent(java.io.File fromFile, java.io.File toFile) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream inputStream, int maxSize, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream inputStream, long maxSize, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public static void copyFileOrDir(java.io.File from, java.io.File to) throws java.io.IOException
java.io.IOException
public static void copyFileOrDir(java.io.File from, java.io.File to, boolean isDir) throws java.io.IOException
java.io.IOException
public static void copyDir(java.io.File fromDir, java.io.File toDir) throws java.io.IOException
java.io.IOException
public static void copyDirContent(java.io.File fromDir, java.io.File toDir) throws java.io.IOException
fromDir
to toDir
.
It's equivalent to "cp --dereference -r fromDir/* toDir" unix command.fromDir
- source directorytoDir
- destination directoryjava.io.IOException
- in case of any IO troublespublic static void copyDir(java.io.File fromDir, java.io.File toDir, boolean copySystemFiles) throws java.io.IOException
java.io.IOException
public static void copyDir(java.io.File fromDir, java.io.File toDir, java.io.FileFilter filter) throws java.io.IOException
java.io.IOException
public static void ensureExists(java.io.File dir) throws java.io.IOException
java.io.IOException
public static java.lang.String getNameWithoutExtension(java.io.File file)
public static java.lang.String getNameWithoutExtension(java.lang.String name)
public static java.lang.String createSequentFileName(java.io.File aParentFolder, java.lang.String aFilePrefix, java.lang.String aExtension)
public static java.lang.String createSequentFileName(java.io.File aParentFolder, java.lang.String aFilePrefix, java.lang.String aExtension, Condition<? super java.io.File> condition)
public static java.io.File findSequentNonexistentFile(java.io.File parentFolder, java.lang.String filePrefix, java.lang.String extension)
public static java.io.File findSequentFile(java.io.File parentFolder, java.lang.String filePrefix, java.lang.String extension, Condition<? super java.io.File> condition)
parentFolder
- the parent folder of the file to be returnedfilePrefix
- the prefix of the file to be returnedextension
- the extension of the file to be returnedcondition
- the check of the file to be returnedpublic static java.lang.String toSystemDependentName(java.lang.String aFileName)
public static java.lang.String toSystemIndependentName(java.lang.String aFileName)
public static java.lang.String toCanonicalPath(java.lang.String path)
File.getCanonicalPath()
will return) - so use with care.toCanonicalPath(String, boolean)
instead.public static java.lang.String toCanonicalPath(java.lang.String path, boolean resolveSymlinksIfNecessary)
File.getCanonicalPath()
.root/ dir1/ link_to_dir1 dir2/'root/dir1/link_to_dir1/../dir2' should be resolved to 'root/dir2'
public static java.lang.String toCanonicalPath(java.lang.String path, char separatorChar)
public static java.lang.String toCanonicalUriPath(java.lang.String path)
public static java.lang.String normalize(java.lang.String path)
public static java.lang.String unquote(java.lang.String urlString)
public static boolean isFilePathAcceptable(java.io.File root, java.io.FileFilter fileFilter)
public static boolean rename(java.io.File source, java.lang.String newName) throws java.io.IOException
java.io.IOException
public static void rename(java.io.File source, java.io.File target) throws java.io.IOException
java.io.IOException
public static boolean filesEqual(java.io.File file1, java.io.File file2)
public static boolean pathsEqual(java.lang.String path1, java.lang.String path2)
public static boolean namesEqual(java.lang.String name1, java.lang.String name2)
public static int compareFiles(java.io.File file1, java.io.File file2)
public static int comparePaths(java.lang.String path1, java.lang.String path2)
public static int fileHashCode(java.io.File file)
public static int pathHashCode(java.lang.String path)
@Deprecated public static java.lang.String getExtension(java.lang.String fileName)
FileUtilRt.getExtension(String)
instead to get the unchanged extension.
If you need to check whether a file has a specified extension use FileUtilRt.extensionEquals(String, String)
public static java.lang.String resolveShortWindowsName(java.lang.String path) throws java.io.IOException
java.io.IOException
public static boolean containsWindowsShortName(java.lang.String path)
public static void collectMatchedFiles(java.io.File root, java.util.regex.Pattern pattern, java.util.List<? super java.io.File> outFiles)
public static java.lang.String convertAntToRegexp(java.lang.String antPattern)
public static java.lang.String convertAntToRegexp(java.lang.String antPattern, boolean ignoreStartingSlash)
antPattern
- ant-style path patterntoSystemIndependentName(java.lang.String)
public static boolean moveDirWithContent(java.io.File fromDir, java.io.File toDir)
public static java.lang.String sanitizeFileName(java.lang.String name)
public static java.lang.String sanitizeFileName(java.lang.String name, boolean strict)
public static java.lang.String sanitizeFileName(java.lang.String name, boolean strict, java.lang.String replacement)
public static boolean canExecute(java.io.File file)
public static boolean canWrite(java.lang.String path)
public static void setReadOnlyAttribute(java.lang.String path, boolean readOnlyFlag)
public static void appendToFile(java.io.File file, java.lang.String text) throws java.io.IOException
java.io.IOException
public static void writeToFile(java.io.File file, byte [] text) throws java.io.IOException
java.io.IOException
public static void writeToFile(java.io.File file, java.lang.String text) throws java.io.IOException
java.io.IOException
public static void writeToFile(java.io.File file, java.lang.String text, boolean append) throws java.io.IOException
java.io.IOException
public static void writeToFile(java.io.File file, byte [] text, int off, int len) throws java.io.IOException
java.io.IOException
public static void writeToFile(java.io.File file, byte [] text, boolean append) throws java.io.IOException
java.io.IOException
public static JBTreeTraverser<java.io.File> fileTraverser(java.io.File root)
public static boolean processFilesRecursively(java.io.File root, Processor<? super java.io.File> processor)
@Deprecated public static boolean processFilesRecursively(java.io.File root, Processor<? super java.io.File> processor, Processor<? super java.io.File> directoryFilter)
fileTraverser(File)
public static java.io.File findFirstThatExist(java.lang.String... paths)
public static java.util.List<java.io.File> findFilesByMask(java.util.regex.Pattern pattern, java.io.File dir)
public static java.util.List<java.io.File> findFilesOrDirsByMask(java.util.regex.Pattern pattern, java.io.File dir)
public static java.lang.String findFileInProvidedPath(java.lang.String providedPath, java.lang.String... fileNames)
@Deprecated public static boolean isAbsolutePlatformIndependent(java.lang.String path)
PathUtil
or NIO2
instead@Deprecated public static boolean isUnixAbsolutePath(java.lang.String path)
PathUtil
or NIO2
instead@Deprecated public static boolean isWindowsAbsolutePath(java.lang.String path)
PathUtil
or NIO2
insteadpublic static java.lang.String getLocationRelativeToUserHome(java.lang.String path)
public static java.lang.String getLocationRelativeToUserHome(java.lang.String path, boolean unixOnly)
public static java.lang.String expandUserHome(java.lang.String path)
public static java.io.File [] notNullize(java.io.File [] files)
public static java.io.File [] notNullize(java.io.File [] files, java.io.File [] defaultFiles)
public static boolean isHashBangLine(java.lang.CharSequence firstCharsIfText, java.lang.String marker)
public static java.io.File createTempDirectory(java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
java.io.IOException
public static java.io.File createTempDirectory(java.lang.String prefix, java.lang.String suffix, boolean deleteOnExit) throws java.io.IOException
java.io.IOException
public static java.io.File createTempDirectory(java.io.File dir, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
java.io.IOException
public static java.io.File createTempDirectory(java.io.File dir, java.lang.String prefix, java.lang.String suffix, boolean deleteOnExit) throws java.io.IOException
java.io.IOException
public static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
java.io.IOException
public static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix, boolean deleteOnExit) throws java.io.IOException
java.io.IOException
public static java.io.File createTempFile(java.io.File dir, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
java.io.IOException
public static java.io.File createTempFile(java.io.File dir, java.lang.String prefix, java.lang.String suffix, boolean create) throws java.io.IOException
java.io.IOException
public static java.io.File createTempFile(java.io.File dir, java.lang.String prefix, java.lang.String suffix, boolean create, boolean deleteOnExit) throws java.io.IOException
java.io.IOException
public static java.lang.String getTempDirectory()
public static void resetCanonicalTempPathCache(java.lang.String tempPath)
public static java.io.File generateRandomTemporaryPath() throws java.io.IOException
java.io.IOException
public static void setExecutable(java.io.File file) throws java.io.IOException
java.io.IOException
@Deprecated public static void setExecutableAttribute(java.lang.String path, boolean executableFlag) throws java.io.IOException
setExecutable(File)
or File.setExecutable(boolean, boolean)
java.io.IOException
public static java.lang.String loadFile(java.io.File file) throws java.io.IOException
java.io.IOException
public static java.lang.String loadFile(java.io.File file, boolean convertLineSeparators) throws java.io.IOException
java.io.IOException
public static java.lang.String loadFile(java.io.File file, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static java.lang.String loadFile(java.io.File file, java.nio.charset.Charset encoding) throws java.io.IOException
java.io.IOException
public static java.lang.String loadFile(java.io.File file, java.lang.String encoding, boolean convertLineSeparators) throws java.io.IOException
java.io.IOException
public static char [] loadFileText(java.io.File file) throws java.io.IOException
java.io.IOException
public static char [] loadFileText(java.io.File file, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static char [] loadText(java.io.Reader reader, int length) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> loadLines(java.io.File file) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> loadLines(java.io.File file, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> loadLines(java.lang.String path) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> loadLines(java.lang.String path, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> loadLines(java.io.BufferedReader reader) throws java.io.IOException
java.io.IOException
public static byte [] loadBytes(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public static byte [] loadBytes(java.io.InputStream stream, int length) throws java.io.IOException
java.io.IOException
public static java.util.List<java.lang.String> splitPath(java.lang.String path)
public static java.util.List<java.lang.String> splitPath(java.lang.String path, char separatorChar)
public static boolean visitFiles(java.io.File root, Processor<? super java.io.File> processor)
public static boolean deleteWithRenaming(java.io.File file)
public static boolean isFileSystemCaseSensitive(java.lang.String path) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.lang.String getUrl(java.io.File file)