com.pow2.util
Class FileUtil

java.lang.Object
  extended bycom.pow2.util.FileUtil

public class FileUtil
extends Object

FileUtil class.
Contains static methods for file access.

Author:
foxat

Constructor Summary
FileUtil()
           
 
Method Summary
static Properties getProperties(String propsFile)
          Read the Java properties file specified by the input propsFile parameter, and use its content to instance a new Properties object.
static Properties getProperties(String propsFile, boolean addToSystemProps)
          Read the Java properties file specified by the input propsFile parameter, and use its content to instance a new Properties object.
static StringBuffer read(String file)
          Read the text file whose fullpath is specified by the input file parameter, and return the StringBuffer object containing its content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

read

public static StringBuffer read(String file)
                         throws Exception
Read the text file whose fullpath is specified by the input file parameter, and return the StringBuffer object containing its content.

Parameters:
file - the file fullpath
Returns:
the StringBuffer object containing the file content
Throws:
Exception - if any error occurs.

getProperties

public static Properties getProperties(String propsFile)
                                throws Exception
Read the Java properties file specified by the input propsFile parameter, and use its content to instance a new Properties object.

Parameters:
propsFile - the name of the Java Properties file to read
Returns:
the Properties object containing the properties readed from the input file
Throws:
Exception - if any error occcurs.

getProperties

public static Properties getProperties(String propsFile,
                                       boolean addToSystemProps)
                                throws Exception
Read the Java properties file specified by the input propsFile parameter, and use its content to instance a new Properties object.

Parameters:
propsFile - the name of the Java Properties file to read
addToSystemProps - Description of the Parameter
Returns:
the Properties object containing the properties readed from the input file
Throws:
Exception - if any error occcurs.


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.