public class FileSourceFactory extends Object
A graph reader factory allow to create readers according to a given file. It both tries to read the start of the file to infer its type (works well for file formats with a magic cookie or header), and if it fails it tries to look at the file name extension.
|Constructor and Description|
|Modifier and Type||Method and Description|
Create a file input for the given file name.
public static FileSource sourceFor(String fileName) throws IOException
This method first tests if the file is a regular file and is readable. If so, it opens it and reads the magic cookie to test the known file formats that can be inferred from their header. If it works, it returns a file input for the format. Else it looks at the file name extension, and returns a file input for the extension. Finally if all fail, it throws a NotFoundException.
Notice that this method only creates the file input and does not connect it to a graph.
fileName- Name of the graph file.
IOException- If the file is not readable or accessible.
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses