|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.AbstractGuiseApplication
public abstract class AbstractGuiseApplication
An abstract base class for a Guise application.
This implementation only works with Guise containers that descend from AbstractGuiseContainer.
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.globalmentor.net.Resource |
|---|
URI_PROPERTY_NAME |
| Constructor Summary | |
|---|---|
AbstractGuiseApplication(java.net.URI uri)
URI constructor. |
|
| Method Summary | ||
|---|---|---|
void |
addDestination(Destination destination)
Registers a destination so that it can be matched against one or more paths. |
|
void |
addDestination(Destination destination,
boolean priority)
Registers a destination so that it can be matched against one or more paths. |
|
void |
checkInstalled()
Checks to ensure that this application is installed. |
|
void |
checkNotInstalled()
Checks to ensure that this application is not installed. |
|
ApplicationFrame |
createApplicationFrame()
Creates a frame for the application. |
|
GuiseSession |
createSession(Platform platform)
Creates a new session for the application on the given platform. |
|
com.globalmentor.net.URIPath |
createTempAsset(java.lang.String baseName,
java.lang.String extension,
GuiseSession restrictionSession)
Creates a temporary asset available at an application navigation path. |
|
java.net.URL |
getAssetURL(com.globalmentor.net.URIPath path,
GuiseSession guiseSession)
Returns a URL to the asset at the given path. |
|
com.globalmentor.net.URIPath |
getBasePath()
Reports the base path of the application. |
|
java.net.URI |
getBaseURI()
Reports the base URI where the application is installed. |
|
|
getConfiguration(java.lang.Class<C> configurationClass)
Returns the configuration for the given configuration type. |
|
GuiseContainer |
getContainer()
|
|
java.lang.String |
getDCSID()
|
|
java.net.URI |
getDepictionURI(java.net.URI depictionRootURI,
java.net.URI navigationURI)
Determines the depiction URI based upon a navigation URI. |
|
java.net.URI |
getDepictionURI(java.net.URI depictionRootURI,
com.globalmentor.net.URIPath navigationPath)
Determines the depiction URI based upon a navigation path. |
|
Destination |
getDestination(com.globalmentor.net.URIPath path)
Determines the destination associated with the given application context-relative path. |
|
java.lang.Iterable<Destination> |
getDestinations()
Returns an iterable of destinations. |
|
Environment |
getEnvironment()
|
|
java.io.File |
getHomeDirectory()
Returns the home directory shared by all sessions of this application. |
|
java.io.InputStream |
getInputStream(java.net.URI uri)
Retrieves an input stream to the entity at the given URI. |
|
java.io.InputStream |
getInputStream(com.globalmentor.net.URIPath path)
Retrieves an input stream to the entity at the given path. |
|
java.lang.String |
getLocaleResourcePath(java.lang.String resourceBasePath,
java.util.Locale locale)
Determines the locale-sensitive path of the given resource path. |
|
java.util.List<java.util.Locale> |
getLocales()
|
|
java.io.File |
getLogDirectory()
Returns the log directory shared by all sessions of this application. |
|
java.io.Writer |
getLogWriter(java.lang.String baseFilename,
com.globalmentor.io.IOOperation<java.io.Writer> initializer,
com.globalmentor.io.IOOperation<java.io.Writer> uninitializer)
Retrieves a writer suitable for recording log information for the application. |
|
java.util.Map<?,?> |
getMailProperties()
Returns the properties of the mail manager. |
|
java.util.Queue<Message> |
getMailSendQueue()
Retrieves the queue used to send mail. |
|
Session |
getMailSession()
Retrieves the current mail session. |
|
com.globalmentor.net.URIPath |
getNavigationPath(java.net.URI depictionURI)
Determines the logical navigation path based upon a requested depiction URI. |
|
java.io.OutputStream |
getOutputStream(java.net.URI uri)
Retrieves an output stream to the entity at the given URI. |
|
java.io.OutputStream |
getOutputStream(com.globalmentor.net.URIPath path)
Retrieves an output stream to the entity at the given path. |
|
protected char[] |
getPassword(java.security.Principal principal)
Looks up the corresponding password for the given principal. |
|
protected java.security.Principal |
getPrincipal(java.lang.String id)
Looks up a principal from the given ID. |
|
protected java.lang.String |
getRealm(com.globalmentor.net.URIPath applicationPath)
Determines the realm applicable for the resource indicated by the given application path. |
|
java.lang.String |
getResourceBundleBaseName()
|
|
java.io.InputStream |
getResourceInputStream(java.lang.String resourcePath)
Retrieves an input stream to the resource at the given path. |
|
com.globalmentor.io.IO<Resources> |
getResourcesIO()
|
|
GuiseSession |
getSession(java.util.UUID uuid)
Retrieves a Guise session for the given UUID. |
|
java.net.URI |
getStyleURI()
|
|
java.util.Set<java.util.Locale> |
getSupportedLocales()
|
|
java.io.File |
getTempDirectory()
Returns the temprary directory shared by all sessions of this application. |
|
com.globalmentor.io.IO<Theme> |
getThemeIO()
|
|
java.net.URI |
getThemeURI()
|
|
java.net.URI |
getURI()
Returns the application identifier URI. |
|
boolean |
hasAsset(com.globalmentor.net.URIPath path)
Determines whether this application has an asset at the given path. |
|
boolean |
hasDestination(com.globalmentor.net.URIPath path)
Determines if there is a destination associated with the given appplication context-relative path. |
|
boolean |
hasResource(java.lang.String resourcePath)
Determines if the application has a resource available stored at the given resource path. |
|
void |
install(AbstractGuiseContainer container,
java.net.URI baseURI,
java.io.File homeDirectory,
java.io.File logDirectory,
java.io.File tempDirectory)
Installs the application into the given container at the given base URI. |
|
protected boolean |
isAuthorized(com.globalmentor.net.URIPath applicationPath,
java.security.Principal principal,
java.lang.String realm)
Checks whether the given principal is authorized to access the resouce at the given application path. |
|
boolean |
isInstalled()
|
|
boolean |
isThemed()
|
|
java.util.Properties |
loadProperties(java.lang.String propertiesPath)
Loads properties from a file in the home directory. |
|
java.util.ResourceBundle |
loadResourceBundle(Theme theme,
java.util.Locale locale)
Retrieves a resource bundle for the given theme in the given locale. |
|
protected java.util.ResourceBundle |
loadResourceBundle(Theme theme,
java.util.Locale locale,
java.util.ResourceBundle parentResourceBundle)
Retrieves a resource bundle from this theme and its resolving parents, if any. |
|
protected java.util.ResourceBundle |
loadResourceBundle(java.net.URI resourceBundleURI,
java.util.ResourceBundle parentResourceBundle)
Loads a resource bundle from the given URI. |
|
Theme |
loadTheme(java.net.URI themeURI)
Loads a theme from the given URI. |
|
void |
registerSession(GuiseSession guiseSession)
Registers a session with this application. |
|
com.globalmentor.net.URIPath |
relativizePath(com.globalmentor.net.URIPath path)
Changes an absolute path to an application-relative path. |
|
com.globalmentor.net.URIPath |
relativizeURI(java.net.URI uri)
Changes a URI to an application-relative path. |
|
protected
|
removeConfiguration(java.lang.Class<C> configurationClass)
Removes a configuration of the given type. |
|
com.globalmentor.net.URIPath |
resolvePath(com.globalmentor.net.URIPath path)
Resolves a relative or absolute path against the application base path. |
|
java.net.URI |
resolveURI(java.net.URI uri)
Resolves a URI against the application base path. |
|
void |
setBaseURI(java.net.URI baseURI)
Sets the base URI of the application. |
|
protected
|
setConfiguration(C configuration)
Sets the given configuration, associating it with its class. |
|
protected
|
setConfiguration(java.lang.Class<C> configurationClass,
C configuration)
Sets the given configuration. |
|
protected void |
setConfigurations(com.globalmentor.config.Configuration... configurations)
Sets the given configurations, associating them with their respective classes. |
|
void |
setDCSID(java.lang.String dcsID)
Sets the Data Collection Server log identifier. |
|
void |
setDestinations(java.util.List<Destination> destinations)
Associates multiple destinations with application context-relative paths or path patterns. |
|
void |
setEnvironment(Environment newEnvironment)
Sets the application local environment. |
|
void |
setLocales(java.util.List<java.util.Locale> newLocales)
Sets the list of supported locales. |
|
void |
setLogLevel(com.globalmentor.log.Log.Level level)
Sets the log level that will be logged. |
|
void |
setMailProperties(java.util.Map<?,?> mailProperties)
Sets properties of the mail manager. |
|
void |
setResourceBundleBaseName(java.lang.String newResourceBundleBaseName)
Changes the resource bundle base name. |
|
void |
setStyleURI(java.net.URI newStyle)
Sets the URI of the style of the application. |
|
void |
setThemed(boolean newThemed)
Sets whether the application applies themes. |
|
void |
setThemeURI(java.net.URI newThemeURI)
Sets the URI of the application theme. |
|
void |
uninstall(GuiseContainer container)
Uninstalls the application from the given container. |
|
void |
unregisterSession(GuiseSession guiseSession)
Unregisters a session from this application. |
|
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public AbstractGuiseApplication(java.net.URI uri)
uri - The URI for the application, or null if there is no identifier is not known.| Method Detail |
|---|
public com.globalmentor.io.IO<Resources> getResourcesIO()
getResourcesIO in interface GuiseApplicationpublic com.globalmentor.io.IO<Theme> getThemeIO()
getThemeIO in interface GuiseApplicationprotected void setConfigurations(com.globalmentor.config.Configuration... configurations)
configurations - The configurations to set.protected <C extends com.globalmentor.config.Configuration> C setConfiguration(C configuration)
C - The type of configuration being set.configuration - The configuration to set.
null if there was no previous configuration for that class.
java.lang.NullPointerException - if the given configuration is null.
protected <C extends com.globalmentor.config.Configuration> C setConfiguration(java.lang.Class<C> configurationClass,
C configuration)
C - The type of configuration being set.configurationClass - The class with which to associate the configuration.configuration - The configuration to set.
null if there was no previous configuration for that class.public <C extends com.globalmentor.config.Configuration> C getConfiguration(java.lang.Class<C> configurationClass)
getConfiguration in interface com.globalmentor.config.ConfigurationManagedC - The type of configuration to retrieve.configurationClass - The class of configuration to retrieve.
null if there was no configuration for that class.protected <C extends com.globalmentor.config.Configuration> C removeConfiguration(java.lang.Class<C> configurationClass)
C - The type of configuration being removed.configurationClass - The class with which the configuration is associated.
null if there was no previous configuration for that class.public java.net.URI getURI()
getURI in interface com.globalmentor.net.Resourcenull if the identifier is not known.public GuiseContainer getContainer()
getContainer in interface GuiseApplicationnull if the application is not yet installed.public Environment getEnvironment()
getEnvironment in interface GuiseApplicationpublic void setEnvironment(Environment newEnvironment)
setEnvironment in interface GuiseApplicationnewEnvironment - The new application local environment.
java.lang.NullPointerException - if the given environment is null.GuiseApplication.ENVIRONMENT_PROPERTYpublic java.util.Map<?,?> getMailProperties()
null value after the application is installed.
getMailProperties in interface GuiseApplicationcom.globalmentor.config.ConfigurationException - if the application is installed into a container but the mail properties has not been configured.public void setMailProperties(java.util.Map<?,?> mailProperties)
setMailProperties in interface GuiseApplicationmailProperties - The new properties of the mail manager
java.lang.NullPointerException - if the given properties is null.
java.lang.IllegalStateException - if the application has already been installed into a container.public Session getMailSession()
getMailSession in interface GuiseApplicationjava.lang.IllegalStateException - if the application has not yet been installed into a container.
com.globalmentor.config.ConfigurationException - if mail has not been configured for this application.public java.util.Queue<Message> getMailSendQueue()
getMailSendQueue in interface GuiseApplicationjava.lang.IllegalStateException - if the application has not yet been installed into a container.
com.globalmentor.config.ConfigurationException - if mail has not been configured for this application.public boolean isThemed()
isThemed in interface GuiseApplicationpublic void setThemed(boolean newThemed)
Boolean.
setThemed in interface GuiseApplicationnewThemed - true if the application should apply themes, else false.GuiseApplication.THEMED_PROPERTYpublic com.globalmentor.net.URIPath getNavigationPath(java.net.URI depictionURI)
getNavigationPath in interface GuiseApplicationdepictionURI - The plain absolute depiction URI.
java.lang.NullPointerException - if the given depiction URI is null.GuiseApplication.GUISE_RESERVED_BASE_PATH
public final java.net.URI getDepictionURI(java.net.URI depictionRootURI,
com.globalmentor.net.URIPath navigationPath)
The requested navigation path is allowed to be in three forms:
/full/path/file.ext, which is typically resolved to the root depiction URI.path/file.ext, which is typically transformed if needed based upon hosts configured for sub-paths.This implementation delegates to getDepictionURI(URI, URI).
getDepictionURI in interface GuiseApplicationdepictionRootURI - The plain, absolute, root URI depiction currently in use.navigationPath - The logical navigation path, either relative to the application, or absolute to the host.
public java.net.URI getDepictionURI(java.net.URI depictionRootURI,
java.net.URI navigationURI)
The requested navigation URI is allowed to be in three forms:
http://www.cnn.com/, which is typically returned unmodified./full/path/file.ext, which is typically resolved to the root depiction URI.path/file.ext, which is typically transformed if needed based upon hosts configured for sub-paths.This version resolves the navigation URI to the base path, but otherwise returns the navigation URI unmodified.
getDepictionURI in interface GuiseApplicationdepictionRootURI - The plain, absolute, root URI depiction currently in use.navigationURI - The logical navigation URI, either absolute, relative to the application, or absolute to the host.
public GuiseSession createSession(Platform platform)
createSession in interface GuiseApplicationplatform - The platform on which this session's objects are depicted.
java.lang.NullPointerException - if the given platform is null.public void registerSession(GuiseSession guiseSession)
registerSession in interface GuiseApplicationguiseSession - The Guise session to register with this Guise application.
java.lang.IllegalStateException - if the given session has alreaady been registered with this application.public void unregisterSession(GuiseSession guiseSession)
unregisterSession in interface GuiseApplicationguiseSession - The Guise session to unregister from this Guise application.
java.lang.IllegalStateException - if the given session is not registered with this application.public GuiseSession getSession(java.util.UUID uuid)
getSession in interface GuiseApplicationuuid - The UUID of the Guise session to retrieve.
null if no Guise session is associated with the given UUID.
java.lang.NullPointerException - if the given UUID is null.public ApplicationFrame createApplicationFrame()
createApplicationFrame in interface GuiseApplicationpublic java.net.URI getBaseURI()
null if no application base URI has been specified and the application is not yet installed.getBasePath()public void setBaseURI(java.net.URI baseURI)
baseURI - The base URI where the application is installed, which must be an absolute URI with an absolute collection path (e.g. http://www.example.com/path/).
java.lang.NullPointerException - if the given base URI is null.
java.lang.IllegalArgumentException - if the given URI is not absolute or the path of which is not absolute or not a collection.
java.lang.IllegalStateException - if the application is already installed.getBasePath()public com.globalmentor.net.URIPath getBasePath()
getBasePath in interface GuiseApplicationnull if no application base URI has been specified and the application is not yet installed.public java.io.File getHomeDirectory()
getHomeDirectory in interface GuiseApplicationjava.lang.IllegalStateException - if the application has not yet been installed into a container.public java.io.File getLogDirectory()
getLogDirectory in interface GuiseApplicationjava.lang.IllegalStateException - if the application has not yet been installed into a container.public java.io.File getTempDirectory()
getTempDirectory in interface GuiseApplicationjava.lang.IllegalStateException - if the application has not yet been installed into a container.
public java.io.Writer getLogWriter(java.lang.String baseFilename,
com.globalmentor.io.IOOperation<java.io.Writer> initializer,
com.globalmentor.io.IOOperation<java.io.Writer> uninitializer)
throws java.io.IOException
getLogWriter in interface GuiseApplicationbaseFilename - The base filename (e.g. "base.log") that will be used in generating a log file for the current date (e.g. "base 2003-02-01.log").initializer - The encapsulation of any initialization that should be performed on any new writer, or null if no initialization is requested.uninitializer - The encapsulation of any uninitialization that should be performed on any new writer, or null if no uninitialization is requested.
java.io.IOExceptionGuiseApplication.getLogDirectory()public boolean isInstalled()
isInstalled in interface GuiseApplicationgetContainer(),
getBasePath()public void checkInstalled()
checkInstalled in interface GuiseApplicationjava.lang.IllegalStateException - if the application is not installed.isInstalled()public void checkNotInstalled()
java.lang.IllegalStateException - if the application is installed.isInstalled()
public void install(AbstractGuiseContainer container,
java.net.URI baseURI,
java.io.File homeDirectory,
java.io.File logDirectory,
java.io.File tempDirectory)
GuiseContainer and should not be called directly by applications.
This implementation configures logging.
Mail is enabled if mail properties have been configured using setMailProperties(Map).
install in interface GuiseApplicationcontainer - The Guise container into which the application is being installed.baseURI - The base URI at which the application is being installed.homeDirectory - The home directory of the application.logDirectory - The log directory of the application.tempDirectory - The temporary directory of the application.
java.lang.NullPointerException - if the container, base URI, home directory, log directory, and/or temporary directory is null.
java.lang.IllegalArgumentException - if the given base URI is not absolute or the path of which is not absolute or not a collection.
java.lang.IllegalArgumentException - if the context path is not absolute and does not end with a slash ('/') character.
java.lang.IllegalStateException - if the application is already installed.public void uninstall(GuiseContainer container)
GuiseContainer and should not be called directly by applications.
uninstall in interface GuiseApplicationcontainer - The Guise container into which the application is being installed.
java.lang.IllegalStateException - if the application is not installed or is installed into another container.public java.lang.String getDCSID()
getDCSID in interface GuiseApplicationnull if no DCS ID is known.public void setDCSID(java.lang.String dcsID)
setDCSID in interface GuiseApplicationdcsID - The identifier for logging to a Data Collection System such as WebTrends, or null if no DCS ID is known.public java.util.List<java.util.Locale> getLocales()
getLocales in interface GuiseApplicationpublic void setLocales(java.util.List<java.util.Locale> newLocales)
setLocales in interface GuiseApplicationnewLocales - The new supported application locales.
java.lang.NullPointerException - if the given list of locales is null.
java.lang.IllegalArgumentException - if the given list of locales is empty.GuiseApplication.LOCALES_PROPERTYpublic java.util.Set<java.util.Locale> getSupportedLocales()
public java.lang.String getResourceBundleBaseName()
getResourceBundleBaseName in interface GuiseApplicationnull if no custom resource bundle is specified for this application..public void setResourceBundleBaseName(java.lang.String newResourceBundleBaseName)
setResourceBundleBaseName in interface GuiseApplicationnewResourceBundleBaseName - The new base name of the resource bundle, or null if no custom resource bundle is specified for this application.GuiseApplication.RESOURCE_BUNDLE_BASE_NAME_PROPERTYpublic java.net.URI getStyleURI()
getStyleURI in interface GuiseApplicationnull if the default style should be used.public void setStyleURI(java.net.URI newStyle)
setStyleURI in interface GuiseApplicationnewStyle - The URI of the application style, or null if the default style should be used.GuiseApplication.STYLE_URI_PROPERTYpublic java.net.URI getThemeURI()
getThemeURI in interface GuiseApplicationpublic void setThemeURI(java.net.URI newThemeURI)
setThemeURI in interface GuiseApplicationnewThemeURI - The URI of the new application theme.
java.lang.NullPointerException - if the given theme URI is null.GuiseApplication.THEME_URI_PROPERTYpublic void setLogLevel(com.globalmentor.log.Log.Level level)
setLogLevel in interface GuiseApplicationlevel - The minimum level to be logged.
java.lang.NullPointerException - if the given level is null.public void addDestination(Destination destination)
addDestination in interface GuiseApplicationdestination - The description of the destination at the appplication context-relative path or path pattern.
java.lang.NullPointerException - if the destination is null.
public void addDestination(Destination destination,
boolean priority)
addDestination in interface GuiseApplicationdestination - The description of the destination at the appplication context-relative path or path pattern.priority - Whether this destination takes priority over other destinations when there are multiple matches;
if this destination has no path pattern, this parameter is ignored.
java.lang.NullPointerException - if the destination is null.public void setDestinations(java.util.List<Destination> destinations)
setDestinations in interface GuiseApplicationdestinations - The destinations to set.public Destination getDestination(com.globalmentor.net.URIPath path)
getDestination in interface GuiseApplicationpath - The address for which a destination should be retrieved.
null if no destination is associated with the path.
java.lang.IllegalArgumentException - if the provided path is absolute.public java.lang.Iterable<Destination> getDestinations()
getDestinations in interface GuiseApplicationpublic boolean hasDestination(com.globalmentor.net.URIPath path)
hasDestination in interface GuiseApplicationpath - The appplication context-relative path.
true if there is destination associated with the given path, or false if no destination is associated with the given path.
java.lang.NullPointerException - if the path is null.
java.lang.IllegalArgumentException - if the provided path is absolute.public com.globalmentor.net.URIPath resolvePath(com.globalmentor.net.URIPath path)
resolvePath in interface GuiseApplicationpath - The path to be resolved.
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority (in which case resolveURI(URI) should be used instead).getBasePath(),
resolveURI(URI)public java.net.URI resolveURI(java.net.URI uri)
resolveURI in interface GuiseApplicationuri - The URI to be resolved.
java.lang.NullPointerException - if the given URI is null.getBasePath(),
resolvePath(URIPath)public com.globalmentor.net.URIPath relativizePath(com.globalmentor.net.URIPath path)
relativizePath in interface GuiseApplicationpath - The path to be relativized.
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority (in which case resolveURI(URI) should be used instead).getBasePath(),
relativizeURI(URI)public com.globalmentor.net.URIPath relativizeURI(java.net.URI uri)
relativizeURI in interface GuiseApplicationuri - The URI to be relativized.
java.lang.NullPointerException - if the given URI is null.getBasePath(),
#relativizePath(String)
public java.lang.String getLocaleResourcePath(java.lang.String resourceBasePath,
java.util.Locale locale)
getLocaleResourcePath in interface GuiseApplicationresourceBasePath - An application-relative base path to a resource in the application resource storage area.locale - The locale to use in generating candidate resource names.
null if no resource exists at the given resource base path or any of its locale candidates.
java.lang.NullPointerException - if the given resource base path and/or locale is null.
java.lang.IllegalArgumentException - if the given resource path is absolute.
java.lang.IllegalArgumentException - if the given path is not a valid path.hasResource(String)public boolean hasResource(java.lang.String resourcePath)
AbstractGuiseContainer.hasResource(String).
hasResource in interface GuiseApplicationresourcePath - An application-relative path to a resource in the application resource storage area.
true if a resource exists at the given resource path.
java.lang.IllegalArgumentException - if the given resource path is absolute.
java.lang.IllegalArgumentException - if the given path is not a valid path.public java.io.InputStream getResourceInputStream(java.lang.String resourcePath)
AbstractGuiseContainer.getResourceInputStream(String).
getResourceInputStream in interface GuiseApplicationresourcePath - An application-relative path to a resource in the application resource storage area.
null if no resource exists at the given resource path.
java.lang.IllegalArgumentException - if the given resource path is absolute.
java.lang.IllegalArgumentException - if the given path is not a valid path.
public java.io.InputStream getInputStream(java.net.URI uri)
throws java.io.IOException
getInputStream in interface GuiseApplicationuri - A URI to the entity; either absolute or relative to the application.
null if no entity exists at the given resource path.
java.lang.NullPointerException - if the given URI is null.
java.lang.IllegalStateException - if a Guise public temporary resource was requested that requires a particular Guise session, and the request was not made from the required session.
java.io.IOException - if there was an error connecting to the entity at the given URI.resolveURI(URI)
public java.io.InputStream getInputStream(com.globalmentor.net.URIPath path)
throws java.io.IOException
getInputStream in interface GuiseApplicationpath - A path that is either relative to the application context path or is absolute.
null if no entity exists at the given resource path.
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority (in which case getInputStream(URI) should be used instead).
java.lang.IllegalStateException - if a Guise public temporary resource was requested that requires a particular Guise session, and the request was not made from the required session.
java.io.IOException - if there was an error connecting to the entity at the given path.getInputStream(URI)
public java.io.OutputStream getOutputStream(java.net.URI uri)
throws java.io.IOException
getOutputStream in interface GuiseApplicationuri - A URI to the entity; either absolute or relative to the application.
java.lang.NullPointerException - if the given URI is null.
java.lang.IllegalStateException - if a Guise public temporary resource was requested that requires a particular Guise session, and the request was not made from the required session.
java.io.FileNotFoundException - if a URI to a temporary file was passed before the file was created using #createTempAsset(String, String, boolean).
java.io.IOException - if there was an error connecting to the entity at the given URI.resolveURI(URI),
#createTempAsset(String, String, boolean)
public java.io.OutputStream getOutputStream(com.globalmentor.net.URIPath path)
throws java.io.IOException
getOutputStream in interface GuiseApplicationpath - A path that is either relative to the application context path or is absolute.
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalStateException - if a Guise public temporary resource was requested that requires a particular Guise session, and the request was not made from the required session.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority (in which case getOutputStream(URI) should be used instead).
java.io.FileNotFoundException - if a path to a temporary file was passed before the file was created using #createTempAsset(String, String, boolean).
java.io.IOException - if there was an error connecting to the entity at the given URI.getOutputStream(URI),
#createTempAsset(String, String, boolean)
public com.globalmentor.net.URIPath createTempAsset(java.lang.String baseName,
java.lang.String extension,
GuiseSession restrictionSession)
throws java.io.IOException
createTempAsset in interface GuiseApplicationbaseName - The base filename to be used in generating the filename.extension - The extension to use for the temporary file.restrictionSession - The Guise session to which access access to the temporary file should be restricted, or null if there should be no access restriction.
java.lang.NullPointerException - if the given base name and/or extension is null.
java.lang.IllegalArgumentException - if the base name is the empty string.
java.lang.IllegalStateException - if the given restriction session is not registered with this application.
java.io.IOException - if there is a problem creating the asset.getTempDirectory(),
hasAsset(URIPath)
public boolean hasAsset(com.globalmentor.net.URIPath path)
throws java.io.IOException
hasAsset in interface GuiseApplicationpath - The application-relative path of the asset.
true if an asset exists at the given path.
java.io.IOException - if there was an error accessing the asset.#createTempAsset(String, String, boolean),
Guise.hasAsset(String)
public java.net.URL getAssetURL(com.globalmentor.net.URIPath path,
GuiseSession guiseSession)
throws java.io.IOException
getAssetURL in interface GuiseApplicationpath - The application-relative path of the asset.session - The Guise session requesting the asset, or null if there is no session associated with the request.
null if there is no such asset.
java.lang.IllegalStateException - if an asset was requested that requires a particular Guise session different from the given Guise session.
java.io.IOException - if there was an error accessing the asset.#createTempAsset(String, String, boolean),
Guise.getAssetURL(String)
public java.util.ResourceBundle loadResourceBundle(Theme theme,
java.util.Locale locale)
throws java.io.IOException
loadResourceBundle in interface GuiseApplicationtheme - The current theme in effect.locale - The locale for which resources should be retrieved.
java.io.IOException - if there was an error loading a resource bundle.getResourceBundleBaseName()
protected java.util.ResourceBundle loadResourceBundle(Theme theme,
java.util.Locale locale,
java.util.ResourceBundle parentResourceBundle)
throws java.io.IOException
theme - The theme for which to load resources.locale - The locale for which resources should be retrieved.parentResourceBundle - The resource bundle to serve as the parent, or null if there is no parent resource bundle.
java.io.IOException - if there was an error loading a resource bundle.
protected java.util.ResourceBundle loadResourceBundle(java.net.URI resourceBundleURI,
java.util.ResourceBundle parentResourceBundle)
throws java.io.IOException
resourceBundleURI - The URI of the resource bundle to load.parentResourceBundle - The resource bundle to serve as the parent, or null if there is no parent resource bundle.
java.io.IOException - if there was an error loading the resource bundle.
public Theme loadTheme(java.net.URI themeURI)
throws java.io.IOException
loadTheme in interface GuiseApplicationthemeURI - The URI of the theme to load.
java.lang.NullPointerException - if the given theme URI is null.
java.io.IOException - if there is an error loading the theme or one of its parents.
public java.util.Properties loadProperties(java.lang.String propertiesPath)
throws java.io.IOException
loadProperties in interface GuiseApplicationpropertiesPath - The path to the properties file, relative to the application home directory.
java.lang.NullPointerException - if the given properties path is null.
java.lang.IllegalArgumentException - if the type of properties file is not recognized.
java.io.IOException - if there is an error loading the properties.getHomeDirectory()protected java.security.Principal getPrincipal(java.lang.String id)
null.
id - The ID of the principal.
null if no principal could be determined.protected char[] getPassword(java.security.Principal principal)
null.
principal - The principal for which a password should be returned.
null if no password is associated with the given principal.protected java.lang.String getRealm(com.globalmentor.net.URIPath applicationPath)
applicationPath - The relative path of the resource requested.
null if the given resource is not in a known realm.
protected boolean isAuthorized(com.globalmentor.net.URIPath applicationPath,
java.security.Principal principal,
java.lang.String realm)
applicationPath - The relative path of the resource requested.principal - The principal requesting authentication, or null if the principal is not known.realm - The realm with which the resource is associated, or null if the realm is not known.
true if the given principal is authorized to access the resource represented by the given application path.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||