public class FileUtil extends Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File source,
File destination)
Deprecated.
|
static void |
createDirIfNotExists(File dir)
Deprecated.
|
static File |
createTempDir(String prefix)
Deprecated.
|
static boolean |
deleteChildren(File directory)
Deprecated.
|
static void |
deleteDir(File dir)
Deletes the specified directory and any files and directories in it recursively.
|
static boolean |
deleteFiles(File directory)
Deprecated.
|
static boolean |
deltree(File directory)
Deprecated.
|
static String |
getFileExtension(String fileName)
Deprecated.
|
static File |
getRelativeFile(File subj,
File relativeTo)
Deprecated.
|
static String |
getRelativePath(File subj,
File relativeTo)
Deprecated.
|
static boolean |
isLegalFileName(String fileName)
Deprecated.
|
static boolean |
isLegalFileNameChar(char c)
Deprecated.
|
static boolean |
moveRecursive(File from,
File to,
Collection<File> excludes)
Deprecated.
|
@Deprecated public static String getRelativePath(File subj, File relativeTo)
subj
- The File to find the relative form for.relativeTo
- The File 'subj' should be made relative to.@Deprecated public static File getRelativeFile(File subj, File relativeTo)
subj
- The File to find the relative form for.relativeTo
- The File 'subj' should be made relative to.@Deprecated public static String getFileExtension(String fileName)
fileName
- A file name.@Deprecated public static boolean isLegalFileName(String fileName)
fileName
- name of the file@Deprecated public static boolean isLegalFileNameChar(char c)
c
- character to check@Deprecated public static void copyFile(File source, File destination) throws IOException
source
- source filedestination
- destination fileIOException
@Deprecated public static void createDirIfNotExists(File dir) throws IOException
dir
- The directory to create.IOException
- If the creation of the directory failed.@Deprecated public static boolean deltree(File directory)
directory
- file or directory to delete@Deprecated public static boolean deleteFiles(File directory)
directory
- @Deprecated public static boolean deleteChildren(File directory)
directory
- @Deprecated public static boolean moveRecursive(File from, File to, Collection<File> excludes)
from
- File or directory to be movedto
- The file or directory to rename toexcludes
- The File objects to be excluded; if a directory is excluded, all files under it are excluded as
well!@Deprecated public static File createTempDir(String prefix) throws IOException
Files.createTempDirectory(String, java.nio.file.attribute.FileAttribute...)
insteadprefix
- The prefix string to be used in generating the directory's name; must be at least three characters
long.IOException
- If no directory could be created.public static void deleteDir(File dir) throws IOException
dir
- The directory to remove.IOException
- If the directory could not be removed.Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.