com.canoo.webtest.boundary
Class FileBoundary

java.lang.Object
  extended by com.canoo.webtest.boundary.FileBoundary

public final class FileBoundary
extends Object

Helper class for working with files.

Author:
Paul King, Marc Guillemot

Method Summary
static byte[] getBytes(File file)
          Gets the bytes of the file
static File getFile(String filename, Class relativeClass)
          Helper method when creating files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFile

public static File getFile(String filename,
                           Class relativeClass)
Helper method when creating files.

Parameters:
filename - the filename of the resource to get
relativeClass - the class whose package contains the resource
Returns:
the File if it exists
Throws:
IllegalStateException - if the file could not be found

getBytes

public static byte[] getBytes(File file)
Gets the bytes of the file

Parameters:
file - the file to read
Returns:
the file content
Throws:
RuntimeException - if the content can't be read

Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved.