|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.util.io.IOLib
public class IOLib
Library routines for input/output tasks.
Method Summary | |
---|---|
static java.lang.String |
getExtension(java.io.File f)
Returns the extension for a file or null if there is none |
static java.lang.String |
getExtension(java.lang.String filename)
Returns the extension for a file or null if there is none |
static Graph |
getGraphFile(java.awt.Component c)
Present a file chooser dialog for loading a Graph or Tree data set. |
static Table |
getTableFile(java.awt.Component c)
Present a file chooser dialog for loading a Table data set. |
static boolean |
isGZipFile(java.lang.String file)
Indicates if the given file ends with a file extension of ".gz" or ".Z", indicating a GZip file. |
static boolean |
isUrlString(java.lang.String s)
Indicates if a given String is a URL string. |
static boolean |
isZipFile(java.lang.String file)
Indicates if the given file ends with a file extension of ".zip", indicating a Zip file. |
static ByteArrayList |
readAsBytes(java.io.InputStream is)
Reads an input stream into a list of byte values. |
static java.lang.String |
readAsString(java.io.InputStream is)
Reads an input stream into a single String result. |
static java.lang.String |
readAsString(java.lang.String location)
Reads data pulled from the given location string into a single String result. |
static java.io.InputStream |
streamFromString(java.lang.String location)
Get an input string corresponding to the given location string. |
static java.net.URL |
urlFromString(java.lang.String location)
From a string description, attempt to generate a URL object. |
static java.net.URL |
urlFromString(java.lang.String location,
java.lang.Class referrer,
boolean includeFileSystem)
From a string description, attempt to generate a URL object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isUrlString(java.lang.String s)
s
- the string to check
public static java.net.URL urlFromString(java.lang.String location)
location
- the location string for which to get a URL object
public static java.net.URL urlFromString(java.lang.String location, java.lang.Class referrer, boolean includeFileSystem)
includeFileSystem
flag is true, a file on the local filesystem
(resulting in a file:// URL). The String will be checked in that order
in an attempt to resolve it to a valid URL.
location
- the location string for which to get a URL objectreferrer
- the class to check for classpath resource items, the
location string will be resolved against the package/folder containing
this classincludeFileSystem
- indicates if the file system should be
included in the search to resolve the location String
public static java.io.InputStream streamFromString(java.lang.String location) throws java.io.IOException
location
- the location string
java.io.IOException
- if an input/ouput error occurspublic static java.lang.String getExtension(java.io.File f)
f
- the input file
public static boolean isGZipFile(java.lang.String file)
file
- a String of the filename or URL of the file
public static boolean isZipFile(java.lang.String file)
file
- a String of the filename or URL of the file
public static java.lang.String getExtension(java.lang.String filename)
filename
- the input filename
public static ByteArrayList readAsBytes(java.io.InputStream is) throws java.io.IOException
is
- the input stream to read
java.io.IOException
- if an input/ouput error occurspublic static java.lang.String readAsString(java.io.InputStream is) throws java.io.IOException
is
- the input stream to read
java.io.IOException
- if an input/ouput error occurspublic static java.lang.String readAsString(java.lang.String location) throws java.io.IOException
streamFromString(String)
method, then read the input stream
into a String result.
location
- the location String
java.io.IOException
- if an input/ouput error occursstreamFromString(String)
public static Table getTableFile(java.awt.Component c)
c
- user interface component from which the request is being made
public static Graph getGraphFile(java.awt.Component c)
c
- user interface component from which the request is being made
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |