Package io.guise.framework
Interface GuiseContainer
-
- All Known Implementing Classes:
AbstractGuiseContainer
,HTTPServletGuiseContainer
public interface GuiseContainer
The interface for a Guise container.- Author:
- Garret Wilson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<GuiseApplication>
getApplications()
com.globalmentor.net.URIPath
getBasePath()
Reports the base path of the container.java.net.URI
getBaseURI()
Reports the base URI of the container.java.io.InputStream
getInputStream(java.net.URI uri)
Retrieves an input stream to the entity at the given URI.com.globalmentor.net.URIPath
resolvePath(com.globalmentor.net.URIPath path)
Resolves a relative or absolute path against the container base path.java.net.URI
resolveURI(java.net.URI uri)
Resolves URI against the container base path.
-
-
-
Method Detail
-
getBaseURI
java.net.URI getBaseURI()
Reports the base URI of the container. The base URI is an absolute URI that ends with the base path, which ends with a slash ('/').- Returns:
- The base URI representing the Guise container.
-
getBasePath
com.globalmentor.net.URIPath getBasePath()
Reports the base path of the container. The base path is an absolute path that ends with a slash ('/'), indicating the base path of the application base paths.- Returns:
- The base path representing the Guise container.
-
resolvePath
com.globalmentor.net.URIPath resolvePath(com.globalmentor.net.URIPath path)
Resolves a relative or absolute path against the container base path. Relative paths will be resolved relative to the container base path. Absolute paths will be be considered already resolved. For a container base path "/path/to/container/", resolving "relative/path" will yield "/path/to/container/relative/path", while resolving "/absolute/path" will yield "/absolute/path".- Parameters:
path
- The path to be resolved.- Returns:
- The path resolved against the container base path.
- Throws:
java.lang.NullPointerException
- if the given path isnull
.java.lang.IllegalArgumentException
- if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority (in which caseresolveURI(URI)
should be used instead).- See Also:
getBasePath()
-
resolveURI
java.net.URI resolveURI(java.net.URI uri)
Resolves URI against the container base path. Relative paths will be resolved relative to the container base path. Absolute paths will be considered already resolved, as will absolute URIs. For a container base path "/path/to/container/", resolving "relative/path" will yield "/path/to/container/relative/path", while resolving "/absolute/path" will yield "/absolute/path". Resolving "http://example.com/path" will yield "http://example.com/path".- Parameters:
uri
- The URI to be resolved.- Returns:
- The URI resolved against the container base path.
- Throws:
java.lang.NullPointerException
- if the given URI isnull
.- See Also:
getBasePath()
-
getInputStream
java.io.InputStream getInputStream(java.net.URI uri) throws java.io.IOException
Retrieves an input stream to the entity at the given URI. The URI is first resolved to the container base URI.- Parameters:
uri
- A URI to the entity; either absolute or relative to the container.- Returns:
- An input stream to the entity at the given resource URI, or
null
if no entity exists at the given resource path. - Throws:
java.lang.NullPointerException
- if the given URI isnull
.java.io.IOException
- if there was an error connecting to the entity at the given URI.- See Also:
getBaseURI()
-
getApplications
java.util.Collection<GuiseApplication> getApplications()
- Returns:
- The applications currently installed in this container.
-
-