org.openqa.selenium.io
Class FileHandler

java.lang.Object
  extended by org.openqa.selenium.io.FileHandler

public class FileHandler
extends Object

Utility methods for common filesystem activities


Nested Class Summary
static interface FileHandler.Filter
          Used by file operations to determine whether or not to make use of a file.
 
Constructor Summary
FileHandler()
           
 
Method Summary
static void copy(File from, File to)
           
static void copy(File source, File dest, String suffix)
           
static void copyResource(File outputDir, Class<?> forClassLoader, String... names)
           
static boolean createDir(File dir)
           
static boolean delete(File toDelete)
           
static boolean isZipped(String fileName)
           
static boolean makeWritable(File file)
           
static String readAsString(File toRead)
           
static File unzip(InputStream resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler()
Method Detail

unzip

public static File unzip(InputStream resource)
                  throws IOException
Throws:
IOException

copyResource

public static void copyResource(File outputDir,
                                Class<?> forClassLoader,
                                String... names)
                         throws IOException
Throws:
IOException

createDir

public static boolean createDir(File dir)
                         throws IOException
Throws:
IOException

makeWritable

public static boolean makeWritable(File file)
                            throws IOException
Throws:
IOException

isZipped

public static boolean isZipped(String fileName)

delete

public static boolean delete(File toDelete)

copy

public static void copy(File from,
                        File to)
                 throws IOException
Throws:
IOException

copy

public static void copy(File source,
                        File dest,
                        String suffix)
                 throws IOException
Throws:
IOException

readAsString

public static String readAsString(File toRead)
                           throws IOException
Throws:
IOException


Copyright © 2011. All Rights Reserved.