edu.washington.cs.knowitall.commonlib
Class FileUtils

java.lang.Object
  extended by edu.washington.cs.knowitall.commonlib.FileUtils

public class FileUtils
extends Object


Constructor Summary
FileUtils()
           
 
Method Summary
static ArrayList<File> find(File path, Boolean recursive)
          Return all files beneath path.
static String getExtension(File f)
          Get the text after the final dot (.) in the file name.
static void pipe(InputStream is, OutputStream os)
          Writes all lines read from the reader.
static void pipe(InputStream is, OutputStream os, int buffersize)
          Writes all lines read from the reader.
static void pipe(Reader reader, Writer writer)
          Writes all lines read from the reader.
static void pipe(Reader reader, Writer writer, int buffersize)
          Writes all lines read from the reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

getExtension

public static String getExtension(File f)
Get the text after the final dot (.) in the file name.

Parameters:
f - The file to get the extension of.
Returns:
The extension of File f.

pipe

public static void pipe(Reader reader,
                        Writer writer)
                 throws IOException
Writes all lines read from the reader.

Parameters:
reader - The source reader
writer - The destination writer
Throws:
IOException

pipe

public static void pipe(Reader reader,
                        Writer writer,
                        int buffersize)
                 throws IOException
Writes all lines read from the reader.

Parameters:
reader - the source reader
writer - the destination writer
buffersize - size of the buffer to use
Throws:
IOException

pipe

public static void pipe(InputStream is,
                        OutputStream os)
                 throws IOException
Writes all lines read from the reader.

Parameters:
is - The input stream
os - The output stream
Throws:
IOException

pipe

public static void pipe(InputStream is,
                        OutputStream os,
                        int buffersize)
                 throws IOException
Writes all lines read from the reader.

Parameters:
is - The input stream
os - The output stream
buffersize - size of the buffer to use
Throws:
IOException

find

public static ArrayList<File> find(File path,
                                   Boolean recursive)
Return all files beneath path.

Parameters:
path - the path to search
recursive - iff true, search subdirectories too.
Returns:


Copyright © 2012 University of Washington CSE. All Rights Reserved.