org.apache.kahadb.util
public final class IOHelper extends java.lang.Object
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(java.io.File src,
java.io.File dest) |
static void |
copyInputStream(java.io.InputStream in,
java.io.OutputStream out) |
static boolean |
delete(java.io.File top) |
static java.lang.String |
getDefaultDataDirectory() |
static java.lang.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 java.lang.String |
getDefaultStoreDirectory() |
static void |
mkdirs(java.io.File dir) |
static void |
moveFile(java.io.File src,
java.io.File targetDirectory) |
static java.lang.String |
toFileSystemDirectorySafeName(java.lang.String name)
Converts any string into a string that is safe to use as a file name.
|
static java.lang.String |
toFileSystemSafeName(java.lang.String name) |
static java.lang.String |
toFileSystemSafeName(java.lang.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 java.lang.String getDefaultDataDirectory()
public static java.lang.String getDefaultStoreDirectory()
public static java.lang.String getDefaultDirectoryPrefix()
public static java.lang.String toFileSystemDirectorySafeName(java.lang.String name)
name
- public static java.lang.String toFileSystemSafeName(java.lang.String name)
public static java.lang.String toFileSystemSafeName(java.lang.String name, boolean dirSeparators, int maxFileLength)
name
- dirSeparators
- maxFileLength
- public static boolean delete(java.io.File top)
public static void moveFile(java.io.File src, java.io.File targetDirectory) throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.File src, java.io.File dest) throws java.io.IOException
java.io.IOException
public static void copyInputStream(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static void mkdirs(java.io.File dir) throws java.io.IOException
java.io.IOException
Copyright © 2005-2014. All Rights Reserved.