jsystem.utils
Class ClassPathFile

java.lang.Object
  extended byjsystem.utils.ClassPathFile

public class ClassPathFile
extends Object

ClassPathFile work with file's class paths.


Constructor Summary
ClassPathFile()
          Creates ClassPathFile with default Java class path.
ClassPathFile(String classPath)
          Constructs a TestCaseLoader.
 
Method Summary
 byte[] getFile(String fileName)
          Read and return file in byte form.
 String getFileAsString(String fileName)
          Read and return file in String form.
 String[] listFile(String dir)
          Read file names include ziped files from directory and class paths set in constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathFile

public ClassPathFile()
Creates ClassPathFile with default Java class path.


ClassPathFile

public ClassPathFile(String classPath)
Constructs a TestCaseLoader. It scans the class path and the excluded package paths

Method Detail

getFileAsString

public String getFileAsString(String fileName)
                       throws FileNotFoundException
Read and return file in String form.

Parameters:
fileName - file to read
Throws:
FileNotFoundException

getFile

public byte[] getFile(String fileName)
               throws FileNotFoundException
Read and return file in byte form.

Parameters:
fileName - file to read
Throws:
FileNotFoundException

listFile

public String[] listFile(String dir)
                  throws IOException
Read file names include ziped files from directory and class paths set in constructor. If no file was found, then is return array with zero length.

Parameters:
dir - Directory to scan
Returns:
file names
Throws:
IOException