com.googlecode.android_scripting
Class FileUtils

java.lang.Object
  extended by com.googlecode.android_scripting.FileUtils

public class FileUtils
extends java.lang.Object

Utility functions for handling files.

Author:
Damon Kohler (damonkohler@gmail.com)

Method Summary
static int chmod(java.io.File path, int mode)
           
static java.io.File copyFromStream(java.lang.String name, java.io.InputStream input)
           
static boolean delete(java.io.File path)
           
static boolean externalStorageMounted()
           
static java.io.File getExternalDownload()
           
static boolean makeDirectories(java.io.File directory, int mode)
           
static java.lang.String readFromAssetsFile(Context context, java.lang.String name)
           
static java.lang.String readToString(java.io.File file)
           
static boolean recursiveChmod(java.io.File root, int mode)
           
static boolean rename(java.io.File file, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

externalStorageMounted

public static boolean externalStorageMounted()

chmod

public static int chmod(java.io.File path,
                        int mode)
                 throws java.lang.Exception
Throws:
java.lang.Exception

recursiveChmod

public static boolean recursiveChmod(java.io.File root,
                                     int mode)
                              throws java.lang.Exception
Throws:
java.lang.Exception

delete

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

copyFromStream

public static java.io.File copyFromStream(java.lang.String name,
                                          java.io.InputStream input)

makeDirectories

public static boolean makeDirectories(java.io.File directory,
                                      int mode)

getExternalDownload

public static java.io.File getExternalDownload()

rename

public static boolean rename(java.io.File file,
                             java.lang.String name)

readToString

public static java.lang.String readToString(java.io.File file)
                                     throws java.io.IOException
Throws:
java.io.IOException

readFromAssetsFile

public static java.lang.String readFromAssetsFile(Context context,
                                                  java.lang.String name)
                                           throws java.io.IOException
Throws:
java.io.IOException