|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.IOUtil
Utility methods for IO operations
| Method Summary | |
static java.lang.String |
getExtension(java.io.File f)
Method getExtension extracts the extension of a given file. |
static java.lang.String |
getExtension(java.lang.String filename)
Method getExtension returns the extension of a given filename. |
static java.lang.String |
getTextContent(java.net.URL url,
java.lang.String encoding)
Reads the contents of the file into a string and returns it. |
static java.io.BufferedInputStream |
getUncompressedStream(java.io.File file)
Returns a stream containing uncompressed data. |
static java.io.BufferedInputStream |
getUncompressedStream(java.io.InputStream is)
Returns a stream containing uncompressed data. |
static boolean |
isCompressed(java.io.File file)
Checks if the given file is compressed in any known format. |
static boolean |
isCompressed(java.io.InputStream is)
Checks if the given stream is compressed in any known format. ! |
static boolean |
isXMLFile(java.io.File file)
Method isXMLFile reads the first line of the file and checks whether it starts with the typical xml definition. |
static boolean |
isXMLFile(java.io.InputStream is)
Method isXMLFile reads the first line of the file and checks whether it starts with the typical xml definition. |
static java.io.File |
redirectWindowsLink(java.io.File linkFile)
Tries to redirect a windows LNK file to the destination it points to |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean isXMLFile(java.io.File file)
file - the File to examine.
true iff the file is an xml file.public static boolean isXMLFile(java.io.InputStream is)
is - the InputStream to examine
true iff the file is an xml file.public static boolean isCompressed(java.io.File file)
file - The file to check
public static boolean isCompressed(java.io.InputStream is)
is - The stream to check
public static java.io.BufferedInputStream getUncompressedStream(java.io.File file)
throws java.io.IOException
file - The input file to read from
java.io.IOException - If reading from the file failed
public static java.io.BufferedInputStream getUncompressedStream(java.io.InputStream is)
throws java.io.IOException
is - The input stream to read from
java.io.IOException - If reading from the stream failedpublic static java.lang.String getExtension(java.io.File f)
f - the file to examine.
public static java.lang.String getExtension(java.lang.String filename)
filename - the name of a file as string.
public static final java.lang.String getTextContent(java.net.URL url,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException,
java.io.IOException
url - The URL to read fromencoding - The encoding of the file
java.io.UnsupportedEncodingException - If the encoding is not supported
java.io.IOException - If there was an error while
readingpublic static final java.io.File redirectWindowsLink(java.io.File linkFile)
linkFile - The original file representing a LNK file
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||