junit.extensions.util
Class FileUtils

java.lang.Object
  |
  +--junit.extensions.util.FileUtils

public class FileUtils
extends java.lang.Object

This class provides some methods for load and saving data from/to a file

Version:
$Id: FileUtils.java,v 1.1 2002/08/29 14:06:44 wdsgoe Exp $
Author:
Siegfried GOESCHL

Constructor Summary
FileUtils()
           
 
Method Summary
static byte[] loadBinary(java.io.File file)
          Load the given file and return the content.
static byte[] loadBinary(java.io.File parentDir, java.lang.String name)
          Load the given file and return the content.
static byte[] loadBinary(java.lang.String name)
          Load the given file and return the content.
static void saveBinary(java.io.File file, byte[] data)
          Save the binary content to a file
static void saveBinary(java.io.File parentDir, java.lang.String name, byte[] data)
          Save the binary content to a file
static void saveBinary(java.lang.String name, byte[] data)
          Save the binary content to a file
static void saveInputStream(java.io.File file, java.io.InputStream is)
          Save the content of an input stream to a file
static void saveInputStream(java.io.File parentDir, java.lang.String name, java.io.InputStream is)
          Save the content of an input stream to a file
static void saveInputStream(java.lang.String name, java.io.InputStream is)
          Save the content of an input stream to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

loadBinary

public static byte[] loadBinary(java.io.File file)
Load the given file and return the content.
Parameters:
file - the file to be loaded
Returns:
the content of the file

loadBinary

public static byte[] loadBinary(java.io.File parentDir,
                                java.lang.String name)
Load the given file and return the content.
Parameters:
parentDir - the parent directory
name - the name of the file within the parentb directory
Returns:
the content of the file

loadBinary

public static byte[] loadBinary(java.lang.String name)
Load the given file and return the content.
Parameters:
name - the name of the file to be loaded
Returns:
the content of the file

saveBinary

public static void saveBinary(java.lang.String name,
                              byte[] data)
Save the binary content to a file
Parameters:
name - the name of the file to store the data
data - the data to be stored

saveBinary

public static void saveBinary(java.io.File parentDir,
                              java.lang.String name,
                              byte[] data)
Save the binary content to a file
Parameters:
parentDir - the parent directory where to store the data
name - the name of the file to store the data
data - the data to be stored

saveBinary

public static void saveBinary(java.io.File file,
                              byte[] data)
Save the binary content to a file
Parameters:
file - the file to store the data
data - the data to be stored

saveInputStream

public static void saveInputStream(java.lang.String name,
                                   java.io.InputStream is)
Save the content of an input stream to a file
Parameters:
name - the name of the file to store the data
is - the input stream to write to a file

saveInputStream

public static void saveInputStream(java.io.File parentDir,
                                   java.lang.String name,
                                   java.io.InputStream is)
Save the content of an input stream to a file
Parameters:
parentDir - the parent directory where to store the data
name - the name of the file to store the data
is - the input stream to write to a file

saveInputStream

public static void saveInputStream(java.io.File file,
                                   java.io.InputStream is)
Save the content of an input stream to a file
Parameters:
file - the file to store the data
is - the input stream to write to a file


Copyright © 2001-2002 IT20one GmbH. All Rights Reserved.