|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.util.WebTools
Class WebTools is a special purpose class for
reading data from a web site.
| Constructor Summary | |
private |
WebTools()
Prevent instantiation. |
| Method Summary | |
static String |
appendSlashIfNeeded(String baseURL)
Appends a slash to a URL string if it is not present. |
static byte[] |
readDataFromWeb(String urlString)
Returns the byte array of data from the web site item with the given URL string. |
static String[] |
readFileNamesFromWeb(String filelistURL,
String filelist)
Returns the file names in the filelist text file located at the given filelist url. |
static String[] |
readNonEmptyLinesFromWeb(String urlString)
Returns the non-empty lines from the string contents of a web site text file with the given URL string. |
static String |
readTextFileFromWeb(String urlString)
Returns the string contents of a web site text file with the given URL string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
private WebTools()
| Method Detail |
public static byte[] readDataFromWeb(String urlString)
Returns the byte array of data from the web site item with the given URL string.
Assumes the data may be read in one call to the input stream reader associated with the URL.
Throws RuntimeException if an error occurs.
urlString - the URL of a web site item as a string
public static String readTextFileFromWeb(String urlString)
Returns the string contents of a web site text file with the given URL string.
Assumes the data may be read in one call to the input stream reader associated with the URL.
Throws RuntimeException if an error occurs.
urlString - the URL of a web site text file as a string
public static String[] readNonEmptyLinesFromWeb(String urlString)
Returns the non-empty lines from the string contents of a web site text file with the given URL string.
Assumes the data may be read in one call to the input stream reader associated with the URL.
Throws RuntimeException if an error occurs.
urlString - the URL of a web site text file as a string
public static String[] readFileNamesFromWeb(String filelistURL,
String filelist)
Returns the file names in the filelist text file located at the given filelist url.
Appends slash to the filelist url string if it is not present.
Assumes that filelist is the name of a text file at the filelist url that contains a list of file names.
Assumes the data may be read in one call to the input stream reader associated with the URL.
If an error occurs, returns a zero-length string array rather than throw an exception.
filelistURL - the URL of a text file with file namesfilelist - the name of a text file with file names
public static String appendSlashIfNeeded(String baseURL)
baseURL - a URL string that may need a trailing slash
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||