com.github.restdriver.serverdriver.file
Class FileHelper

java.lang.Object
  extended by com.github.restdriver.serverdriver.file.FileHelper

public final class FileHelper
extends Object

Utility class to help with loading files from the classpath. User: mjg Date: 21/04/11 Time: 11:51


Method Summary
static String fromFile(String fileName)
          Reads in a resource from the class path, using UTF-8 encoding.
static String fromFile(String fileName, String encoding)
          Reads in a resource from the class path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromFile

public static String fromFile(String fileName,
                              String encoding)
Reads in a resource from the class path.

Parameters:
fileName - The file name to load
encoding - The encoding to use when reading the file
Returns:
The content of the file

fromFile

public static String fromFile(String fileName)
Reads in a resource from the class path, using UTF-8 encoding.

Parameters:
fileName - The file name to load
Returns:
The content of the file


Copyright © 2011. All Rights Reserved.