Package org.apache.calcite.util
Interface Source
public interface Source
Source of data.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a source whose path concatenates this with a child.file()
fileOpt()
path()
protocol()
reader()
Returns a relative source, if this source is a child of a given base.Looks for a suffix on a path and returns either the path with the suffix removed or the original path.@Nullable Source
trimOrNull
(String suffix) Looks for a suffix on a path and returns either the path with the suffix removed or null.url()
-
Method Details
-
url
URL url() -
file
File file() -
fileOpt
-
path
String path() -
reader
- Throws:
IOException
-
openStream
- Throws:
IOException
-
protocol
String protocol() -
trim
Looks for a suffix on a path and returns either the path with the suffix removed or the original path. -
trimOrNull
Looks for a suffix on a path and returns either the path with the suffix removed or null. -
append
Returns a source whose path concatenates this with a child.For example,
- source("/foo").append(source("bar")) returns source("/foo/bar")
- source("/foo").append(source("/bar")) returns source("/bar") because "/bar" was already absolute
-
relative
Returns a relative source, if this source is a child of a given base.For example,
- source("/foo/bar").relative(source("/foo")) returns source("bar")
- source("/baz/bar").relative(source("/foo")) returns source("/baz/bar")
-