Package org.gephi.io.importer.api
Class ImportUtils
- java.lang.Object
-
- org.gephi.io.importer.api.ImportUtils
-
public final class ImportUtils extends Object
- Author:
- Mathieu Bastian
-
-
Constructor Summary
Constructors Constructor Description ImportUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.openide.filesystems.FileObject
getArchivedFile(org.openide.filesystems.FileObject fileObject)
static File
getBzipFile(org.openide.filesystems.FileObject in, File out, boolean isTar)
static File
getGzFile(org.openide.filesystems.FileObject in, File out, boolean isTar)
static LineNumberReader
getTextReader(InputStream stream)
Returns aLineNumberReader
forinputStream
.static LineNumberReader
getTextReader(Reader reader)
static LineNumberReader
getTextReader(org.openide.filesystems.FileObject fileObject)
Returns aLineNumberReader
forfileObject
.static Document
getXMLDocument(InputStream stream)
static Document
getXMLDocument(Reader reader)
static Document
getXMLDocument(org.openide.filesystems.FileObject fileObject)
static XMLStreamReader
getXMLReader(Reader reader)
static boolean
isArchiveFile(org.openide.filesystems.FileObject fileObject)
static Color
parseColor(String colorString)
-
-
-
Method Detail
-
getTextReader
public static LineNumberReader getTextReader(org.openide.filesystems.FileObject fileObject) throws IOException
Returns aLineNumberReader
forfileObject
. The file must be a text file. The charset is detected automatically.- Parameters:
fileObject
- the file object that is to be read- Returns:
- a reader for the text file
- Throws:
IOException
- if the file can't be found or read
-
getTextReader
public static LineNumberReader getTextReader(InputStream stream) throws IOException
Returns aLineNumberReader
forinputStream
. The stream must be a character stream. The charset is detected automatically.- Parameters:
stream
- the stream that is to be read- Returns:
- a reader for the character stream
- Throws:
IOException
- if the stream can't be read
-
getTextReader
public static LineNumberReader getTextReader(Reader reader)
-
getXMLDocument
public static Document getXMLDocument(InputStream stream) throws RuntimeException
- Throws:
RuntimeException
-
getXMLDocument
public static Document getXMLDocument(Reader reader) throws RuntimeException
- Throws:
RuntimeException
-
getXMLDocument
public static Document getXMLDocument(org.openide.filesystems.FileObject fileObject) throws RuntimeException
- Throws:
RuntimeException
-
getXMLReader
public static XMLStreamReader getXMLReader(Reader reader)
-
isArchiveFile
public static boolean isArchiveFile(org.openide.filesystems.FileObject fileObject)
-
getArchivedFile
public static org.openide.filesystems.FileObject getArchivedFile(org.openide.filesystems.FileObject fileObject)
-
getBzipFile
public static File getBzipFile(org.openide.filesystems.FileObject in, File out, boolean isTar) throws IOException
- Throws:
IOException
-
getGzFile
public static File getGzFile(org.openide.filesystems.FileObject in, File out, boolean isTar) throws IOException
- Throws:
IOException
-
-