Package org.apache.calcite.avatica.util

# Interface Source

public interface Source
Source of data.

## Method Summary

Modifier and Type
Method
Description
`Source`
`append(Source child)`
Returns a source whose path concatenates this with a child.
`File`
`file()`
`InputStream`
`openStream()`
`String`
`path()`
`String`
`protocol()`
`Reader`
`reader()`
`Source`
`relative(Source source)`
Returns a relative source, if this source is a child of a given base.
`Source`
`trim(String suffix)`
Looks for a suffix on a path and returns either the path with the suffix removed or the original path.
`Source`
`trimOrNull(String suffix)`
Looks for a suffix on a path and returns either the path with the suffix removed or null.
`URL`
`url()`

## Method Details

### url

URL url()

### file

File file()

### path

String path()

### reader

Reader reader() throws IOException

Throws:
  `IOException`

### openStream

InputStream openStream() throws IOException

Throws:
  `IOException`

### protocol

String protocol()

### trim

Source trim(String suffix)
Looks for a suffix on a path and returns either the path with the suffix removed or the original path.

### trimOrNull

Source trimOrNull(String suffix)
Looks for a suffix on a path and returns either the path with the suffix removed or null.

### append

Source append(Source child)
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

Source relative(Source source)
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")