com.vgrs.xcode.util
Class Datafile

java.lang.Object
  extended by com.vgrs.xcode.util.Datafile

public class Datafile
extends java.lang.Object

Utility methods for retrieving data from files or resources.


Field Summary
static java.lang.String GZIP_SUFFIX
           
static java.lang.String ZIP_SUFFIX
           
 
Constructor Summary
Datafile()
           
 
Method Summary
static java.util.Iterator<java.lang.String> getGzipIterator(java.io.File aFile)
          Retrieve an Iterator over the lines in file.
static java.util.Iterator<java.lang.String> getGzipIterator(java.lang.String aResource)
          Retrieve an Iterator over the lines in resource.
static java.util.Iterator<java.lang.String> getIterator(java.io.File aFile)
          Retrieve an Iterator over the lines in file.
static java.util.Iterator<java.lang.String> getIterator(java.lang.String aResource)
          Retrieve an Iterator over the lines in resource.
static java.util.Iterator<java.lang.String> getTxtIterator(java.io.File aFile)
          Retrieve an Iterator over the lines in file.
static java.util.Iterator<java.lang.String> getTxtIterator(java.lang.String aResource)
          Retrieve an Iterator over the lines in resource.
static java.util.Iterator<java.lang.String> getZipIterator(java.io.File aFile)
          Retrieve an Iterator over the lines in file.
static java.util.Iterator<java.lang.String> getZipIterator(java.lang.String aResource)
          Retrieve an Iterator over the lines in resource.
static java.util.Iterator<java.lang.String> getZipIterator(java.util.zip.ZipInputStream aStream)
          Retrieve an Iterator over the lines in inputstream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GZIP_SUFFIX

public static final java.lang.String GZIP_SUFFIX
See Also:
Constant Field Values

ZIP_SUFFIX

public static final java.lang.String ZIP_SUFFIX
See Also:
Constant Field Values
Constructor Detail

Datafile

public Datafile()
Method Detail

getGzipIterator

public static java.util.Iterator<java.lang.String> getGzipIterator(java.io.File aFile)
                                                            throws XcodeException
Retrieve an Iterator over the lines in file.

Parameters:
aFile - A location on local disk which has been gzipped
Returns:
An Iterator over the lines in file
Throws:
XcodeException - If the file cannot be read

getGzipIterator

public static java.util.Iterator<java.lang.String> getGzipIterator(java.lang.String aResource)
                                                            throws XcodeException
Retrieve an Iterator over the lines in resource.

Parameters:
aResource - A location on the classpath which has been gzipped
Returns:
An Iterator over the lines in resource
Throws:
XcodeException - If the resource cannot be read

getIterator

public static java.util.Iterator<java.lang.String> getIterator(java.io.File aFile)
                                                        throws XcodeException
Retrieve an Iterator over the lines in file.

Parameters:
aFile - A location on local disk
Returns:
An Iterator over the lines in file
Throws:
XcodeException - If the file cannot be read

getIterator

public static java.util.Iterator<java.lang.String> getIterator(java.lang.String aResource)
                                                        throws XcodeException
Retrieve an Iterator over the lines in resource.

Parameters:
aResource - A location on the classpath
Returns:
An Iterator over the lines in resource
Throws:
XcodeException - If the resource cannot be read

getTxtIterator

public static java.util.Iterator<java.lang.String> getTxtIterator(java.io.File aFile)
                                                           throws XcodeException
Retrieve an Iterator over the lines in file.

Parameters:
aFile - A location on local disk
Returns:
An Iterator over the lines in file
Throws:
XcodeException - If the file cannot be read

getTxtIterator

public static java.util.Iterator<java.lang.String> getTxtIterator(java.lang.String aResource)
                                                           throws XcodeException
Retrieve an Iterator over the lines in resource.

Parameters:
aResource - A location on the classpath
Returns:
An Iterator over the lines in resource
Throws:
XcodeException - If the resource cannot be read

getZipIterator

public static java.util.Iterator<java.lang.String> getZipIterator(java.io.File aFile)
                                                           throws XcodeException
Retrieve an Iterator over the lines in file.

Parameters:
aFile - A location on local disk which has been zipped
Returns:
An Iterator over the lines in file
Throws:
XcodeException - If the file cannot be read

getZipIterator

public static java.util.Iterator<java.lang.String> getZipIterator(java.lang.String aResource)
                                                           throws XcodeException
Retrieve an Iterator over the lines in resource.

Parameters:
aResource - A location on the classpath which has been zipped
Returns:
An Iterator over the lines in resource
Throws:
XcodeException - If the resource cannot be read

getZipIterator

public static java.util.Iterator<java.lang.String> getZipIterator(java.util.zip.ZipInputStream aStream)
                                                           throws java.io.IOException
Retrieve an Iterator over the lines in inputstream.

Parameters:
aStream - An InputStream which has been zipped
Returns:
An Iterator over the lines in stream
Throws:
java.io.IOException - If the stream cannot be read


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved