org.apache.cassandra.utils
Class FileUtils
java.lang.Object
org.apache.cassandra.utils.FileUtils
public class FileUtils
- extends java.lang.Object
Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtils
public FileUtils()
shutdown
public static void shutdown()
createDirectory
public static void createDirectory(java.lang.String directory)
throws java.io.IOException
- Throws:
java.io.IOException
createFile
public static void createFile(java.lang.String directory)
throws java.io.IOException
- Throws:
java.io.IOException
isExists
public static boolean isExists(java.lang.String filename)
throws java.io.IOException
- Throws:
java.io.IOException
delete
public static boolean delete(java.lang.String file)
deleteAsync
public static void deleteAsync(java.lang.String file)
throws java.io.IOException
- Throws:
java.io.IOException
delete
public static boolean delete(java.util.List<java.lang.String> files)
throws java.io.IOException
- Throws:
java.io.IOException
delete
public static void delete(java.io.File[] files)
throws java.io.IOException
- Throws:
java.io.IOException
stringifyFileSize
public static java.lang.String stringifyFileSize(double value)
stringToFileSize
public static double stringToFileSize(java.lang.String value)
getUsedDiskSpace
public static long getUsedDiskSpace()
deleteDir
public static boolean deleteDir(java.io.File dir)
- Deletes all files and subdirectories under "dir".
- Parameters:
dir
- Directory to be deleted
- Returns:
- boolean Returns "true" if all deletions were successful.
If a deletion fails, the method stops attempting to
delete and returns "false".
Copyright © 2009 The Apache Software Foundation