Class FileUtils
java.lang.Object
net.thevpc.common.io.FileUtils
- Author:
- taha.bensalah@gmail.com
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Filestatic FilechangeFileExtension(File file, String suffix) static FilechangeFileSuffix(File file, String suffix) static voidstatic voidcopyTree(File in, File out, FileFilter filter) static FileFiltercreateExtensionFilter(FileUtils.ExtentionFilterOptions o, String... extensions) static voidstatic FilecreateTempFile(URL url) static booleandeleteFolderTree(File folder, FileFilter fileFilter) static FileexpandFile(String path) static StringexpandPath(String path) path expansion replaces ~ with ${user.home} property valuestatic String[]expandPath(String path, File cwd) static String[]findFilePathsOrError(String path, File cwd, FileFilter fileFilter) static File[]findFiles(String path, File cwd, FileFilter fileFilter) static File[]findFiles(String path, String base, File cwd, FileFilter fileFilter) static File[]findFilesOrError(String path, File cwd, FileFilter fileFilter) static FilegetAbsoluteFile(File path) static FilegetAbsoluteFile(File cwd, File path) static FilegetAbsoluteFile(File cwd, String path) static StringgetAbsoluteFile2(String path, String cwd) should promote this to FileUtils !!static StringgetAbsolutePath(File cwd, String path) static StringgetAbsolutePath(String path) static StringgetCanonicalPath(File fileName) static Stringretourne le nom du fichier (sans l'extension)static StringgetFileBaseName(String name) static Stringstatic Stringfile extensionstatic StringgetFileName(String name) static Stringretourne le nom du fichier (sans l'extension)static Stringstatic StringgetFileParentPath(String name) static StringgetFilePath(File file) try to return CanonicalPath otherwise AbsolutePathstatic StringgetNameExtension(String name) static StringgetNameWithExtension(String name, String extension) static StringgetNativePath(String path) static StringgetRelativePath(File parent, File son) relative pathstatic booleanisAbsolutePath(String location) static booleanisFilePath(String path) static booleanisFolderWritable(File folder) static voidstatic StringprobeContentType(File file) static StringprobeContentType(String fileName) static StringprobeContentType(URL url) static voidreplaceAllInFile(File file, String oldContent, String newContent) static voidreplaceInFile(File file, String oldContent, String newContent) static voidreplaceInFolder(File folder, FileFilter fileFilter, boolean recurse, String oldContent, String newContent) static FiletoFileLenient(String path) static StringtoValidFileName(String name, String defaultName)
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
deleteFolderTree
-
findFilePathsOrError
-
findFilesOrError
-
findFiles
-
findFiles
-
getCanonicalPath
-
probeContentType
-
probeContentType
-
probeContentType
-
toFileLenient
-
expandFile
-
expandPath
-
replaceInFile
public static void replaceInFile(File file, String oldContent, String newContent) throws IOException - Throws:
IOException
-
replaceAllInFile
public static void replaceAllInFile(File file, String oldContent, String newContent) throws IOException - Throws:
IOException
-
replaceInFolder
public static void replaceInFolder(File folder, FileFilter fileFilter, boolean recurse, String oldContent, String newContent) throws IOException - Throws:
IOException
-
getFileBaseName
-
getFileBaseName
-
getFileParentPath
-
getFileName
-
getFilePath
-
canonize
-
getNameWithExtension
-
getFileNameWithoutExtension
-
getFileNameWithoutExtension
-
getNameExtension
-
isFolderWritable
-
mkdirs
- Throws:
IOException
-
createTempFile
- Throws:
IOException
-
getFileExtension
-
getFileExtension
-
isFilePath
-
getAbsolutePath
-
getAbsoluteFile
-
getAbsoluteFile
-
expandPath
-
getAbsolutePath
-
getAbsoluteFile
-
isAbsolutePath
-
getNativePath
-
getRelativePath
-
createParents
-
createExtensionFilter
public static FileFilter createExtensionFilter(FileUtils.ExtentionFilterOptions o, String... extensions) throws IOException - Throws:
IOException
-
copyTree
- Throws:
IOException
-
copyTree
- Throws:
IOException
-
changeFileSuffix
-
changeFileExtension
-
toValidFileName
-
getAbsoluteFile2
-