MicroTAPAS.util
Class FileUtil

java.lang.Object
  |
  +--MicroTAPAS.util.FileUtil
All Implemented Interfaces:
java.io.Serializable

public class FileUtil
extends java.lang.Object
implements java.io.Serializable

Collection if utillities for reading and writing from/to files.

See Also:
Serialized Form

Field Summary
private static java.lang.String COMMENT_CHAR
           
private static java.lang.String PARAM_SEPERATOR
           
 
Constructor Summary
FileUtil()
           
 
Method Summary
static void createDir(java.lang.String path)
          If a directory does not exist, create it locally
static java.util.Hashtable readConfigFile(java.lang.String file)
          This method reads a config file array (as returned from FileUtil.readFileToArray()), and puts the result into a Hashtable.
static java.lang.String[] readFileToArray(java.lang.String file, java.lang.String comment, java.lang.String paramSeperator)
          This method reads a local file into a String array (each element a line).
static java.lang.String[] readURLFileToArray(java.lang.String urlAddr, java.lang.String comment, java.lang.String paramSeperator)
          This method reads a Internet file into a String array (each element a line).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENT_CHAR

private static final java.lang.String COMMENT_CHAR
See Also:
Constant Field Values

PARAM_SEPERATOR

private static final java.lang.String PARAM_SEPERATOR
See Also:
Constant Field Values
Constructor Detail

FileUtil

public FileUtil()
Method Detail

readConfigFile

public static java.util.Hashtable readConfigFile(java.lang.String file)
This method reads a config file array (as returned from FileUtil.readFileToArray()), and puts the result into a Hashtable.

Parameters:
file - The name of the config file
Returns:
The hashtable containing all keys/properties

readFileToArray

public static java.lang.String[] readFileToArray(java.lang.String file,
                                                 java.lang.String comment,
                                                 java.lang.String paramSeperator)
This method reads a local file into a String array (each element a line).

Returns:
The array containing all lines

readURLFileToArray

public static java.lang.String[] readURLFileToArray(java.lang.String urlAddr,
                                                    java.lang.String comment,
                                                    java.lang.String paramSeperator)
This method reads a Internet file into a String array (each element a line).

Returns:
The array containing all lines

createDir

public static void createDir(java.lang.String path)
If a directory does not exist, create it locally

Parameters:
path - The path of the dir


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.