StocksMonitor 1.5.0

hirondelle.stocks.util
Class FileUtil

Object
  extended by FileUtil

public final class FileUtil
extends Object

Collected methods to ease manipulation of text files.


Constructor Summary
FileUtil()
           
 
Method Summary
static List<String> getStreamAsList(InputStream aInputStream)
          Return the full content of aInputStream as an unmodifiable List of Strings, one for each line of input.
static String getStreamAsString(InputStream aInputStream)
          Return the full content of aInputStream as a String.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

getStreamAsString

public static String getStreamAsString(InputStream aInputStream)
Return the full content of aInputStream as a String.

If aInputStream has no content, then return an empty String.


getStreamAsList

public static List<String> getStreamAsList(InputStream aInputStream)
Return the full content of aInputStream as an unmodifiable List of Strings, one for each line of input.

The iteration order of the returned List reflects the line order in the underlying stream. If aInputStream has no content, then return an empty List.

Intended for text files having structured data, with each line corresponding to a single record. The caller may use this method to transform such a file into a collection, which may be iterated in the usual fashion.


StocksMonitor 1.5.0

Copyright Hirondelle Systems - License - Generated 2008Jul12.10.53