edu.berkeley.cs.db.yfilterplus.utility
Class DocumentReader

java.lang.Object
  |
  +--edu.berkeley.cs.db.yfilterplus.utility.DocumentReader

public class DocumentReader
extends java.lang.Object


Constructor Summary
DocumentReader()
           
 
Method Summary
static java.util.ArrayList getFileNames(java.lang.String docSource)
          get all the files in a directory with the ".xml" file extension
static java.util.ArrayList getFileNames(java.lang.String docSource, int DOCS)
          get a certain number of files in a directory with the ".xml" file extension
static java.util.ArrayList getFileNames(java.lang.String docSource, java.lang.String extension)
          get all the files in a directory with a certain file extension
static java.lang.String getLocalFileName(java.lang.String name)
          get short file name, i.e., the name without the path included it is equivalent to File.getName()
static java.util.ArrayList getShortFileNames(java.lang.String docSource, java.lang.String extension)
          get all the files in a directory with a certain file extension
static void indexDocuments(java.lang.String docDir)
          index all the xml files in a directory that have been sorted alphabetically.
static void main(java.lang.String[] args)
           
static java.lang.String readDoctoString(java.lang.String filename)
          read a document from the disk to a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentReader

public DocumentReader()
Method Detail

readDoctoString

public static java.lang.String readDoctoString(java.lang.String filename)
read a document from the disk to a string

Parameters:
filename -
Returns:

getFileNames

public static java.util.ArrayList getFileNames(java.lang.String docSource,
                                               int DOCS)
get a certain number of files in a directory with the ".xml" file extension

Parameters:
docSource -
DOCS -
Returns:

getFileNames

public static java.util.ArrayList getFileNames(java.lang.String docSource)
get all the files in a directory with the ".xml" file extension

Parameters:
docSource -
Returns:

getFileNames

public static java.util.ArrayList getFileNames(java.lang.String docSource,
                                               java.lang.String extension)
get all the files in a directory with a certain file extension

Parameters:
docSource -
extension -
Returns:

getShortFileNames

public static java.util.ArrayList getShortFileNames(java.lang.String docSource,
                                                    java.lang.String extension)
get all the files in a directory with a certain file extension

Parameters:
docSource -
extension -
Returns:

indexDocuments

public static void indexDocuments(java.lang.String docDir)
index all the xml files in a directory that have been sorted alphabetically.

Parameters:
docDir -

getLocalFileName

public static java.lang.String getLocalFileName(java.lang.String name)
get short file name, i.e., the name without the path included it is equivalent to File.getName()

Parameters:
name -
Returns:

main

public static void main(java.lang.String[] args)