T
- the type of graph configuration this factory creates.public abstract class AbstractGraphConfigFactory<T extends GraphConfig> extends Object
Constructor and Description |
---|
AbstractGraphConfigFactory() |
Modifier and Type | Method and Description |
---|---|
T |
fromClasspath(String path)
Parses a graph config given as classpath path to a JSON file.
|
T |
fromFile(File file)
Parses a graph config given as JSON file.
|
T |
fromFilePath(String path)
Parses a graph config given as path to a JSON file.
|
T |
fromHdfs(String hdfsPath)
Parses a graph config given as HDFS file path to a JSON file.
|
T |
fromHttp(String httpPath)
Parses a graph config given as HTTP url path to a JSON file.
|
T |
fromInputStream(InputStream is)
same as
fromInputStream(InputStream, File) , but with null passed as parent |
T |
fromInputStream(InputStream is, File parent)
Parses a graph config given as input stream.
|
T |
fromJson(String json)
Same as
fromJson(String, File) , but with null passed as parent. |
T |
fromJson(String json, File parent)
Parses a graph config given as JSON string.
|
T |
fromPath(String path)
Parses a graph config given as path.
|
T |
fromProperties(InputStream is)
same as
fromProperties(Properties) , but instantiates a new Properties object from the given InputStream . |
abstract T |
fromProperties(Properties props)
Parses a graph config given as
Properties file. |
public final T fromClasspath(String path) throws IOException
path
- the path on the classpathIOException
- if there was any I/O error during reading given filepublic final T fromFile(File file) throws IOException
file
- the input fileIOException
- if there was any I/O error during reading given filepublic final T fromFilePath(String path) throws IOException
path
- the path to the JSON fileIOException
- if there was any I/O error during reading given filepublic final T fromHdfs(String hdfsPath) throws IOException
hdfsPath
- the HDFS path, e.g. hdfs:/hdfs-hostname:8080/path/to/config.json. Host name and port can be omitted if corresponding Hadoop configuration files are on current classpath. See Hadoop configuration documentation for details.IOException
- if there was any I/O error during reading given filepublic final T fromHttp(String httpPath) throws IOException
httpPath
- HTTP url path, e.g. http://my-host.com/path/to/config.jsonIOException
- if there was any I/O error during reading given filepublic final T fromInputStream(InputStream is) throws IOException
fromInputStream(InputStream, File)
, but with null
passed as parentis
- the input stream to readIOException
- if there was any I/O error during reading given input streampublic final T fromInputStream(InputStream is, File parent) throws IOException
is
- the input stream to readparent
- if not null
, relative paths found in config will resolved against this parentIOException
- if there was any I/O error during reading given input streampublic final T fromJson(String json) throws IOException
fromJson(String, File)
, but with null
passed as parent.json
- the input JSON stringIOException
- if there was any I/O error during reading given JSON stringpublic final T fromJson(String json, File parent) throws IOException
json
- the input JSON stringparent
- if not null
, relative paths found in config will resolved against this parentIOException
- if there was any I/O error during reading given JSON stringpublic final T fromPath(String path) throws IOException
Protocol
of given path by looking at path handler.path
- the path to parse fromIOException
- if there was any I/O error during reading given pathpublic final T fromProperties(InputStream is) throws IOException
fromProperties(Properties)
, but instantiates a new Properties
object from the given InputStream
.is
- the input stream containing graph configuration in Properties
format.IOException
- if there was any I/O error during reading given input streampublic abstract T fromProperties(Properties props)
Properties
file.props
- the input propertiesCopyright © 2015. All rights reserved.