org.apache.kahadb.util
Class IOHelper

java.lang.Object
  extended by org.apache.kahadb.util.IOHelper

public final class IOHelper
extends java.lang.Object


Field Summary
protected static int MAX_DIR_NAME_LENGTH
           
protected static int MAX_FILE_NAME_LENGTH
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DIR_NAME_LENGTH

protected static final int MAX_DIR_NAME_LENGTH

MAX_FILE_NAME_LENGTH

protected static final int MAX_FILE_NAME_LENGTH
Method Detail

getDefaultDataDirectory

public static java.lang.String getDefaultDataDirectory()

getDefaultStoreDirectory

public static java.lang.String getDefaultStoreDirectory()

getDefaultDirectoryPrefix

public 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


toFileSystemDirectorySafeName

public static java.lang.String toFileSystemDirectorySafeName(java.lang.String name)
Converts any string into a string that is safe to use as a file name. The result will only include ascii characters and numbers, and the "-","_", and "." characters.

Parameters:
name -
Returns:

toFileSystemSafeName

public static java.lang.String toFileSystemSafeName(java.lang.String name)

toFileSystemSafeName

public 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. The result will only include ascii characters and numbers, and the "-","_", and "." characters.

Parameters:
name -
dirSeparators -
maxFileLength -
Returns:

delete

public static boolean delete(java.io.File top)

moveFile

public static void moveFile(java.io.File src,
                            java.io.File targetDirectory)
                     throws java.io.IOException
Throws:
java.io.IOException

copyFile

public static void copyFile(java.io.File src,
                            java.io.File dest)
                     throws java.io.IOException
Throws:
java.io.IOException

copyInputStream

public static void copyInputStream(java.io.InputStream in,
                                   java.io.OutputStream out)
                            throws java.io.IOException
Throws:
java.io.IOException

mkdirs

public static void mkdirs(java.io.File dir)
                   throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2005-2016. All Rights Reserved.