Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE |
Modifier and Type | Method and Description |
---|---|
static String |
compactPath(String path)
Compacts a path by stacking it and reducing ..,
and uses OS specific file separators (eg
File.separator ). |
static String |
compactPath(String path,
char separator)
Compacts a path by stacking it and reducing ..,
and uses the given separator.
|
static String |
compactPath(String path,
String separator)
Compacts a file path by stacking it and reducing ..,
and uses the given separator.
|
static void |
copyFile(File from,
File to)
Copies the file
|
static boolean |
createNewFile(File file)
Creates a new file.
|
static File |
createTempFile(String prefix,
String suffix)
Deprecated.
|
static File |
createTempFile(String prefix,
String suffix,
File parentDir) |
static boolean |
deleteFile(File file)
Deletes the file.
|
static File |
getUserDir() |
static boolean |
hasLeadingSeparator(String name)
Does the name start with a leading separator
|
static boolean |
isAbsolute(File file)
Is the given file an absolute file.
|
static boolean |
isWindows()
Returns true, if the OS is windows
|
static String |
normalizePath(String path)
Normalizes the path to cater for Windows and other platforms
|
static String |
onlyExt(String name) |
static String |
onlyExt(String name,
boolean singleMode) |
static String |
onlyPath(String name)
Returns only the leading path (returns null if no path)
|
static void |
removeDir(File d) |
static boolean |
renameFile(File from,
File to,
boolean copyAndDeleteOnRenameFail)
Renames a file.
|
static boolean |
renameFileUsingCopy(File from,
File to)
Rename file using copy and delete strategy.
|
static void |
shutdown()
Deprecated.
|
static String |
stripExt(String name) |
static String |
stripExt(String name,
boolean singleMode) |
static String |
stripFirstLeadingSeparator(String name)
Strip first leading separator
|
static String |
stripLeadingSeparator(String name)
Strip any leading separators
|
static String |
stripPath(String name)
Strips any leading paths
|
static String |
stripTrailingSeparator(String name)
Strip any trailing separators
|
public static final int BUFFER_SIZE
public static File getUserDir()
public static String normalizePath(String path)
public static boolean isWindows()
@Deprecated public static File createTempFile(String prefix, String suffix) throws IOException
IOException
public static File createTempFile(String prefix, String suffix, File parentDir) throws IOException
IOException
public static String stripLeadingSeparator(String name)
public static boolean hasLeadingSeparator(String name)
public static String stripFirstLeadingSeparator(String name)
public static String stripTrailingSeparator(String name)
public static String onlyPath(String name)
public static String compactPath(String path)
File.separator
).public static String compactPath(String path, char separator)
public static String compactPath(String path, String separator)
@Deprecated public static void shutdown()
public static boolean renameFile(File from, File to, boolean copyAndDeleteOnRenameFail) throws IOException
from
- the from fileto
- the to filecopyAndDeleteOnRenameFail
- whether to fallback and do copy and delete, if renameTo failsIOException
- is thrown if error renaming filepublic static boolean renameFileUsingCopy(File from, File to) throws IOException
from
- the file to be renamedto
- the new target fileIOException
- If an I/O error occurs during copy or delete operations.public static void copyFile(File from, File to) throws IOException
from
- the source fileto
- the destination fileIOException
- If an I/O error occurs during copy operationpublic static boolean deleteFile(File file)
file
- the file to deletepublic static boolean isAbsolute(File file)
file
- the filepublic static boolean createNewFile(File file) throws IOException
file
- the fileIOException
- is thrown if error creating the new fileApache Camel