Uses of Interface
com.gengoai.io.resource.Resource
-
Packages that use Resource Package Description com.gengoai.collection.counter Contains implementations for Counters and MultiCounters that are specialized object-double and object-object-double maps.com.gengoai.collection.disk com.gengoai.config Configuration based on json-like syntax that integrates with command line parser, applications, and loggingcom.gengoai.conversion Classes to convert between arbitrary types.com.gengoai.graph.io com.gengoai.io Classes for reading and writing to various different sources, e.g.com.gengoai.io.resource A mix between Java's FileSystem and Spring's Resourcecom.gengoai.io.resource.spi Service providers for various resource implementationscom.gengoai.json Xml StructuredFormat reader and writercom.gengoai.parsing com.gengoai.stream A unified stream interface that can work across Java and Spark streams.com.gengoai.stream.local com.gengoai.stream.spark com.gengoai.string Functions, predicates, and utilities to create, format, parse, and manipulate strings. -
-
Uses of Resource in com.gengoai.collection.counter
Methods in com.gengoai.collection.counter with parameters of type Resource Modifier and Type Method Description static <TYPE> Counter<TYPE>
Counters. readCsv(Resource resource, Class<TYPE> keyClass)
Reads a counter from a CSV file.static <K1,K2>
MultiCounter<K1,K2>MultiCounters. readCsv(Resource resource, Class<K1> key1Class, Class<K2> key2Class)
Reads a multi-counter from a CSV file.default void
Counter. writeCsv(Resource output)
Writes the counter items and values to CSVdefault void
MultiCounter. writeCsv(Resource output)
Writes the counter items and values to CSV -
Uses of Resource in com.gengoai.collection.disk
Constructors in com.gengoai.collection.disk with parameters of type Resource Constructor Description MapDBHandle(@NonNull Resource resource, boolean compressed)
Instantiates a new MapDBHandle. -
Uses of Resource in com.gengoai.config
Methods in com.gengoai.config with parameters of type Resource Modifier and Type Method Description static boolean
Config. isConfigLoaded(Resource configResource)
Determines if a given configuration resource has been loadedstatic void
Config. loadConfig(Resource resource)
Loads a config file -
Uses of Resource in com.gengoai.conversion
Methods in com.gengoai.conversion that return Resource Modifier and Type Method Description Resource
Val. asResource()
Converts the object to resourceResource
Val. asResource(Resource defaultResource)
Converts the object to resource with a given default if the conversion results in a null value.Methods in com.gengoai.conversion with parameters of type Resource Modifier and Type Method Description Resource
Val. asResource(Resource defaultResource)
Converts the object to resource with a given default if the conversion results in a null value. -
Uses of Resource in com.gengoai.graph.io
Methods in com.gengoai.graph.io with parameters of type Resource Modifier and Type Method Description Graph<V>
GraphJson. read(Resource location)
Graph<V>
GraphReader. read(Resource location)
Reads a graph in from a resourcedefault void
GraphRenderer. render(Graph<V> graph, Resource location)
Renders the given graph to the give location, using the defined vertex and edge encoders.void
GraphRenderer. render(Graph<V> graph, Resource location, Multimap<String,String> parameters)
Renders the given graph to the give location, using the defined vertex and edge encoders.void
GraphViz. render(Graph<V> graph, Resource location, Multimap<String,String> parameters)
void
GraphJson. write(Graph<V> graph, Resource location, Multimap<String,String> parameters)
void
GraphViz. write(Graph<V> graph, Resource location, Multimap<String,String> parameters)
void
GraphVizWriter. write(@NonNull Graph<V> graph, @NonNull Resource location)
default void
GraphWriter. write(Graph<V> graph, Resource location)
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.void
GraphWriter. write(Graph<V> graph, Resource location, Multimap<String,String> parameters)
Writes the given graph to the give location in this format, using the defined vertex and edge encoders. -
Uses of Resource in com.gengoai.io
Methods in com.gengoai.io that return Resource Modifier and Type Method Description static Resource
Resources. from(String resource)
Constructs a resource from a string representation.static Resource
Resources. fromClasspath(String resource)
Creases a newClasspathResource
.static Resource
Resources. fromFile(File resource)
Creases a newFileResource
.static Resource
Resources. fromFile(String resource)
Creases a newFileResource
.static Resource
Resources. fromInputStream(InputStream inputStream)
From input stream resource.static Resource
Resources. fromOutputStream(OutputStream outputStream)
From output stream resource.static Resource
Resources. fromReader(Reader reader)
Creates a new Resource that wraps the given readerstatic Resource
Resources. fromStdin()
From stdin resource.static Resource
Resources. fromStdout()
From stdout resource.static Resource
Resources. fromString()
Creates aStringResource
that is empty.static Resource
Resources. fromString(String stringResource)
Creates aStringResource
from the given string.static Resource
Resources. fromWriter(Writer writer)
Creates a new Resource that wraps the given writerstatic Resource
Resources. getJar(@NonNull Class<?> clazz)
Gets the jar file that a class is stored in.static Resource
Resources. temporaryDirectory()
Creates a new Resource that points to a temporary directory.static Resource
Resources. temporaryFile()
Creates a new Resource that points to a temporary file.static Resource
Resources. temporaryFile(String name, String extension)
Creates a resource wrapping a temporary filestatic Resource
Resources. writeObject(Object o)
static Resource
FileUtils. zip(File zipFile, Resource... entries)
Creates a zip file using the given file containing the contents of the given Resource entries.static Resource
FileUtils. zip(File zipFile, Map.Entry<String,Resource>... entries)
Creates a zip file using the given file containing the contents of the given Resource entries where the entries are map entries (or Tuple2) of entry name and entry resource.Methods in com.gengoai.io that return types with arguments of type Resource Modifier and Type Method Description static Iterator<Resource>
Resources. findAllClasspathResources(String pattern)
Finds all resources with the given pattern across loaded ClassLoadersMethods in com.gengoai.io with parameters of type Resource Modifier and Type Method Description void
ZipWriter. addEntry(@NonNull String path, @NonNull Resource entry)
static void
FileUtils. copyWithProgress(@NonNull InputStream in, @NonNull Resource out, double inSize, @NonNull IntConsumer progress)
Iterator<List<String>>
CSV. iterator(@NonNull Resource resource)
Creates an iterator over the rows of the csv filestatic Iterable<Document>
Xml. parse(Resource xmlResource, String tag)
Parses the given XML resource creating sub-documents (DOM) from the elements with the given tag name.static Iterable<Document>
Xml. parse(Resource xmlResource, String tag, EventFilter eventFilter)
Parses the given XML resource creating sub-documents (DOM) from the elements with the given tag name and filtering out events using the given event filter.CSVReader
CSV. reader(Resource resource)
Creates a CSVReader using this specification from a given resourceStream<List<String>>
CSV. rowListStream(@NonNull Resource resource)
Creates a reusable Java Stream over the rows of the csv fileStream<Map<String,String>>
CSV. rowMapStream(@NonNull Resource resource)
Creates a reusable Java Stream over the rows of the csv file returning them as map with key as the column name and value as the value.abstract boolean
SaveMode. validate(Resource resource)
Performs validation on the given resource to check if writing is possibleCSVWriter
CSV. writer(Resource resource)
Creates a CSVWriter using this specification from a given resourcestatic Resource
FileUtils. zip(File zipFile, Resource... entries)
Creates a zip file using the given file containing the contents of the given Resource entries.Constructors in com.gengoai.io with parameters of type Resource Constructor Description MultiFileWriter(Resource baseDirectory, String filePrefix, int numberOfFiles)
Instantiates a new Multi file writer. -
Uses of Resource in com.gengoai.io.resource
Subinterfaces of Resource in com.gengoai.io.resource Modifier and Type Interface Description interface
NonTraversableResource
Defines a resources whose hierarchy is not traversable.interface
ReadOnlyResource
Defines a resource as being Read Onlyinterface
WriteOnlyResource
Defines a resources as being write onlyClasses in com.gengoai.io.resource that implement Resource Modifier and Type Class Description class
BaseResource
Abstract base resourceclass
ByteArrayResource
A Resource that wraps a byte array.class
ClasspathResource
AResource
implementation for resources that exist on the classpath.class
EmptyResource
An empty resourceclass
FileResource
AResource
implementation that wraps aFile
.class
InputStreamResource
Resource that wraps anInputStream
class
OutputStreamResource
Resource that wraps anOutputStream
class
ReaderResource
Resource that wraps aReader
class
StdinResource
Resource that wraps standard inclass
StdoutResource
Resource that wraps standard outclass
StringResource
A resource that wraps a String.class
URIResource
Resource that wraps a URIclass
URLResource
AResource
wrapper for a URL.class
WriterResource
The type Writer resource.class
ZipResource
The type Zip resource.Methods in com.gengoai.io.resource that return Resource Modifier and Type Method Description Resource
ByteArrayResource. append(byte[] byteArray)
Resource
ClasspathResource. append(byte[] byteArray)
Resource
EmptyResource. append(byte[] byteArray)
Resource
FileResource. append(byte[] byteArray)
Resource
OutputStreamResource. append(byte[] byteArray)
default Resource
ReadOnlyResource. append(byte[] byteArray)
Resource
Resource. append(byte[] byteArray)
Appends the given byte array content to the resource.default Resource
Resource. append(String content)
Appends the given string content to the resource.Resource
StdoutResource. append(byte[] byteArray)
Resource
StringResource. append(byte[] byteArray)
Resource
StringResource. append(String content)
Resource
URIResource. append(byte[] byteArray)
Resource
URLResource. append(byte[] byteArray)
Resource
URLResource. append(String content)
Resource
WriterResource. append(byte[] byteArray)
Resource
BaseResource. compressed()
Resource
Resource. compressed()
Sets is compressed.Resource
FileResource. deleteOnExit()
default Resource
Resource. deleteOnExit()
Deletes the resource on extResource
Resource.Deserializer. deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)
Resource
ClasspathResource. getChild(String relativePath)
Resource
FileResource. getChild(String relativePath)
default Resource
NonTraversableResource. getChild(String relativePath)
Resource
Resource. getChild(String relativePath)
Creates a new Resource that is relative to this resource.Resource
StdoutResource. getChild(String relativePath)
Resource
URIResource. getChild(String relativePath)
Resource
URLResource. getChild(String relativePath)
Resource
ZipResource. getChild(String relativePath)
Resource
ClasspathResource. getParent()
Resource
FileResource. getParent()
default Resource
NonTraversableResource. getParent()
Resource
Resource. getParent()
Gets parent.Resource
StdoutResource. getParent()
Resource
URIResource. getParent()
Resource
URLResource. getParent()
Resource
ZipResource. getParent()
Resource
ResourceChildIterator. next()
Resource
BaseResource. setCharset(Charset charset)
Resource
Resource. setCharset(Charset charset)
Sets the charset for reading and writing.Resource
BaseResource. setCompression(Compression compression)
Resource
Resource. setCompression(Compression compression)
Sets the compression algorithm.Resource
BaseResource. setIsCompressed(boolean isCompressed)
Resource
Resource. setIsCompressed(boolean isCompressed)
Sets is compressed.Resource
BaseResource. uncompressed()
Resource
Resource. uncompressed()
Uncompressed resource.default Resource
Resource. write(byte[] content)
Writes the given byte array to the resource overwriting any existing content.default Resource
Resource. write(String content)
Writes the given string to the resource overwriting any existing content.default Resource
Resource. writeObject(Object object)
Serializes an object to the resource using Java Serialization.Methods in com.gengoai.io.resource that return types with arguments of type Resource Modifier and Type Method Description default Iterator<Resource>
NonTraversableResource. childIterator(boolean recursive)
default Iterator<Resource>
NonTraversableResource. childIterator(String pattern, boolean recursive)
default Iterator<Resource>
Resource. childIterator(boolean recursive)
Iterator over the childrendefault Iterator<Resource>
Resource. childIterator(String pattern, boolean recursive)
Iterator over the childrenList<Resource>
ClasspathResource. getChildren(Pattern filePattern, boolean recursive)
List<Resource>
FileResource. getChildren(Pattern pattern, boolean recursive)
default List<Resource>
NonTraversableResource. getChildren()
default List<Resource>
NonTraversableResource. getChildren(boolean recursive)
default List<Resource>
NonTraversableResource. getChildren(String pattern)
default List<Resource>
NonTraversableResource. getChildren(String pattern, boolean recursive)
default List<Resource>
NonTraversableResource. getChildren(Pattern pattern, boolean recursive)
default List<Resource>
Resource. getChildren()
Lists all the resources that are directly under this resource.default List<Resource>
Resource. getChildren(boolean recursive)
Lists all the resources that are directly under this resource.default List<Resource>
Resource. getChildren(String pattern)
Lists all the resources that are directly under this resource.default List<Resource>
Resource. getChildren(String pattern, boolean recursive)
Lists all the resources that are directly under this resource.default List<Resource>
Resource. getChildren(Pattern pattern, boolean recursive)
Lists all the resources that are directly under this resource.List<Resource>
ZipResource. getChildren(Pattern pattern, boolean recursive)
Methods in com.gengoai.io.resource with parameters of type Resource Modifier and Type Method Description default void
Resource. copy(Resource copyTo)
Copies the contents of this resource to anotherConstructors in com.gengoai.io.resource with parameters of type Resource Constructor Description ResourceChildIterator(Resource startingPoint, Pattern filePattern, boolean recursive)
Instantiates a new Child iterator. -
Uses of Resource in com.gengoai.io.resource.spi
Methods in com.gengoai.io.resource.spi that return Resource Modifier and Type Method Description Resource
ByteArrayResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
ClasspathResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
FileResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
ResourceProvider. createResource(String specification, Map<String,String> properties)
Creates a resource with the given specification and properties using aBeanMap
.Resource
StdinResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
StdoutResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
StringResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
URLResourceProvider. createResource(String specification, Map<String,String> properties)
Resource
ZipResourceProvider. createResource(String specification, Map<String,String> properties)
-
Uses of Resource in com.gengoai.json
Methods in com.gengoai.json that return Resource Modifier and Type Method Description static Resource
Json. dump(Object object, @NonNull Resource resource)
Dumps the given object to the given output location in json format.static Resource
Json. dumpPretty(Object object, @NonNull Resource resource)
Dumps the given object to the given output location in json format.Methods in com.gengoai.json with parameters of type Resource Modifier and Type Method Description static Resource
Json. dump(Object object, @NonNull Resource resource)
Dumps the given object to the given output location in json format.static Resource
Json. dumpPretty(Object object, @NonNull Resource resource)
Dumps the given object to the given output location in json format.static JsonEntry
Json. parse(@NonNull Resource json)
Parses the given resource as json entrystatic <T> T
Json. parse(@NonNull Resource resource, @NonNull Type type)
Parses the json in the given resource creating an object of the given class type.static List<JsonEntry>
Json. parseArray(@NonNull Resource resource)
Loads an array of objects from the given resource in json format.static Map<String,JsonEntry>
Json. parseObject(Resource json)
Quicker method for parsing a json string into aMap
ofString
keys andObject
values. -
Uses of Resource in com.gengoai.parsing
Methods in com.gengoai.parsing with parameters of type Resource Modifier and Type Method Description Parser
ParserGenerator. create(Resource input)
Creates aParser
over the lexed tokens in the give inputdefault TokenStream
Lexer. lex(Resource resource)
Reads from the given resource and tokenizes it into tokens -
Uses of Resource in com.gengoai.stream
Methods in com.gengoai.stream with parameters of type Resource Modifier and Type Method Description void
MStream. saveAsTextFile(Resource location)
Save as the stream to a text file at the given location.abstract MStream<String>
StreamingContext. textFile(@NonNull Resource location)
Creates a new MStream where each element is a line in the resources (recursive) at the given location.abstract MStream<String>
StreamingContext. textFile(@NonNull Resource location, boolean wholeFile)
Creates a new MStream where each element is the entire content of a resource (wholeFile = true) or a single line of the resource (wholeFile = False) and resources are gathered recursively from the given location.MStream<String>
StreamingContext. textFile(@NonNull Resource location, @NonNull String pattern)
Creates a new MStream where each element is a line in the resources (recursive) at the given location only reading files matching the given pattern. -
Uses of Resource in com.gengoai.stream.local
Methods in com.gengoai.stream.local with parameters of type Resource Modifier and Type Method Description MStream<String>
LocalStreamingContext. textFile(Resource resource)
MStream<String>
LocalStreamingContext. textFile(Resource location, boolean wholeFile)
-
Uses of Resource in com.gengoai.stream.spark
Methods in com.gengoai.stream.spark with parameters of type Resource Modifier and Type Method Description void
SparkStream. saveAsTextFile(Resource location)
SparkStream<String>
SparkStreamingContext. textFile(Resource location)
MStream<String>
SparkStreamingContext. textFile(Resource location, boolean wholeFile)
-
Uses of Resource in com.gengoai.string
Methods in com.gengoai.string that return Resource Modifier and Type Method Description Resource
TableFormatter. write(Resource resource)
Writes the table to a resource.Methods in com.gengoai.string with parameters of type Resource Modifier and Type Method Description Resource
TableFormatter. write(Resource resource)
Writes the table to a resource.
-