Package org.apache.activemq.util
Class IOHelper
java.lang.Object
org.apache.activemq.util.IOHelper
Collection of File and Folder utility methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidcopyFile(File src, File dest, FilenameFilter filter) static voidcopyInputStream(InputStream in, OutputStream out) static voidcopySingleFile(File src, File dest) static booleanstatic booleandeleteChildren(File parent) static booleandeleteFile(File fileToDelete) static Stringstatic StringAllows 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/ prefixstatic Stringstatic intstatic intstatic voidstatic voidstatic voidmoveFiles(File srcDirectory, File targetDirectory, FilenameFilter filter) static StringConverts any string into a string that is safe to use as a file name.static StringtoFileSystemSafeName(String name) static StringtoFileSystemSafeName(String name, boolean dirSeparators, int maxFileLength) Converts any string into a string that is safe to use as a file name.
-
Field Details
-
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 Details
-
getDefaultDataDirectory
-
getDefaultStoreDirectory
-
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
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:
- safe name of the directory
-
toFileSystemSafeName
-
toFileSystemSafeName
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:
- file system safe name
-
delete
-
deleteFile
-
deleteChildren
-
moveFile
- Throws:
IOException
-
moveFiles
public static void moveFiles(File srcDirectory, File targetDirectory, FilenameFilter filter) throws IOException - Throws:
IOException
-
copyFile
- Throws:
IOException
-
copyFile
- Throws:
IOException
-
copySingleFile
- Throws:
IOException
-
copyInputStream
- Throws:
IOException
-
getMaxDirNameLength
public static int getMaxDirNameLength() -
getMaxFileNameLength
public static int getMaxFileNameLength() -
mkdirs
- Throws:
IOException
-