public final class IOHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
IOHelper.IOStrategy |
Modifier and Type | Field and Description |
---|---|
protected static int |
MAX_DIR_NAME_LENGTH |
protected static int |
MAX_FILE_NAME_LENGTH |
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File src,
File dest) |
static void |
copyInputStream(InputStream in,
OutputStream out) |
static boolean |
deleteChildren(File parent) |
static boolean |
deleteFile(File fileToDelete) |
static String |
getDefaultDataDirectory() |
static String |
getDefaultDirectoryPrefix()
Allows a system property to be used to overload the default data
directory which can be useful for forcing the test cases to use a target/
prefix
|
static String |
getDefaultStoreDirectory() |
static void |
mkdirs(File dir) |
static void |
moveFile(File src,
File targetDirectory) |
static void |
sync(FileDescriptor fd) |
static String |
toFileSystemDirectorySafeName(String name)
Converts any string into a string that is safe to use as a file name.
|
static String |
toFileSystemSafeName(String name) |
static String |
toFileSystemSafeName(String name,
boolean dirSeparators,
int maxFileLength)
Converts any string into a string that is safe to use as a file name.
|
protected static final int MAX_DIR_NAME_LENGTH
protected static final int MAX_FILE_NAME_LENGTH
public static String getDefaultDataDirectory()
public static String getDefaultStoreDirectory()
public static String getDefaultDirectoryPrefix()
public static String toFileSystemDirectorySafeName(String name)
name
- public static String toFileSystemSafeName(String name, boolean dirSeparators, int maxFileLength)
name
- dirSeparators
- maxFileLength
- public static boolean deleteFile(File fileToDelete)
public static boolean deleteChildren(File parent)
public static void moveFile(File src, File targetDirectory) throws IOException
IOException
public static void copyFile(File src, File dest) throws IOException
IOException
public static void copyInputStream(InputStream in, OutputStream out) throws IOException
IOException
public static void mkdirs(File dir) throws IOException
IOException
public static void sync(FileDescriptor fd) throws IOException
IOException
Copyright © 2009–2016 FuseSource, Corp.. All rights reserved.