version 1.0

com.actimind.actiwate.testing.util
Class FileStreamFactory

java.lang.Object
  extended bycom.actimind.actiwate.testing.util.FileStreamFactory
All Implemented Interfaces:
InputStreamFactory

public class FileStreamFactory
extends java.lang.Object
implements InputStreamFactory

Factory for creating InputStreams from files.


Constructor Summary
FileStreamFactory(java.io.File file)
          Creates a new FileStreamFactory.
FileStreamFactory(java.lang.String filename)
          Creates a new FileStreamFactory.
 
Method Summary
 java.io.InputStream createInputStream()
          Creates and returns a new FileInputStream.
 long getLength()
          Returns stream's length in bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileStreamFactory

public FileStreamFactory(java.io.File file)
                  throws java.io.FileNotFoundException,
                         java.lang.IllegalArgumentException
Creates a new FileStreamFactory.

Parameters:
file - file to create InputStreams from.
Throws:
java.io.FileNotFoundException
java.lang.IllegalArgumentException - if file is null

FileStreamFactory

public FileStreamFactory(java.lang.String filename)
                  throws java.io.FileNotFoundException,
                         java.lang.IllegalArgumentException
Creates a new FileStreamFactory.

Parameters:
filename - filename of file to create InputStreams from.
Throws:
java.io.FileNotFoundException
java.lang.IllegalArgumentException - if filename is null
Method Detail

getLength

public long getLength()
Returns stream's length in bytes.

Specified by:
getLength in interface InputStreamFactory
Returns:
stream's length.

createInputStream

public java.io.InputStream createInputStream()
                                      throws java.io.IOException
Creates and returns a new FileInputStream.

Specified by:
createInputStream in interface InputStreamFactory
Returns:
created FileInputStream
Throws:
java.io.IOException


Copyright © 2007 Actimind, Inc. All Rights Reserved.