edu.upenn.crimson.io
Class HTMLFile

java.lang.Object
  extended by edu.upenn.crimson.io.HTMLFile

public class HTMLFile
extends java.lang.Object

Save URL, HTML text, or InputStream as HTML file.

Version:
$Id: HTMLFile.java,v 1.4 2007/05/16 18:55:58 fisher Exp $
Notes:
This may not work for URL or InputStreams

Nested Class Summary
private static class HTMLFile.HTMLFilter
          HTML FileFilter.
 
Constructor Summary
HTMLFile()
           
 
Method Summary
private static java.lang.String saveFileChooser()
          Use a JFileChooser the get the file info for saving HTML to a file.
static void saveInputStream(java.io.InputStream source)
           
static void saveInputStream(java.io.InputStream source, java.lang.String filename, boolean overwrite)
           
static void saveText(java.lang.String source)
          Save the html text to a file.
static void saveText(java.lang.String source, java.lang.String filename, boolean overwrite)
          Save the html text to a file.
static void saveURL(java.net.URL source)
           
static void saveURL(java.net.URL source, java.lang.String filename, boolean overwrite)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLFile

public HTMLFile()
Method Detail

saveURL

public static void saveURL(java.net.URL source)

saveURL

public static void saveURL(java.net.URL source,
                           java.lang.String filename,
                           boolean overwrite)

saveInputStream

public static void saveInputStream(java.io.InputStream source)

saveInputStream

public static void saveInputStream(java.io.InputStream source,
                                   java.lang.String filename,
                                   boolean overwrite)

saveText

public static void saveText(java.lang.String source)
Save the html text to a file. This will overwrite any existing file.

Notes:
need to throw FileIO exceptions, rather than just print errors.

saveText

public static void saveText(java.lang.String source,
                            java.lang.String filename,
                            boolean overwrite)
Save the html text to a file.

Notes:
need to throw FileIO exceptions, rather than just print errors.

saveFileChooser

private static java.lang.String saveFileChooser()
Use a JFileChooser the get the file info for saving HTML to a file.




Copyright 2006 Stephen Fisher, Susan Davidson, and Junhyong Kim, University of Pennsylvania.