Eclipse Remote Application Platform

org.eclipse.rap.rwt.service
Interface ResourceManager

All Superinterfaces:
IResourceManager

public interface ResourceManager
extends IResourceManager

The resource manager is used to register static resources like images, CSS files etc. in order to make them available at a URL.

Since:
2.0

Method Summary
 java.lang.String getLocation(java.lang.String name)
          Returns the location within the web-applications context where the resource will be available for download.
 java.io.InputStream getRegisteredContent(java.lang.String name)
          Returns the content of the registered resource with the given name.
 boolean isRegistered(java.lang.String name)
          Determines whether the resource with the given name has been registered.
 void register(java.lang.String name, java.io.InputStream inputStream)
          Registers a given resource and makes it available for download.
 boolean unregister(java.lang.String name)
          Unregisters the resource with the given name.
 

Method Detail

register

void register(java.lang.String name,
              java.io.InputStream inputStream)
Registers a given resource and makes it available for download. The URL for the registered resource can be obtained from getLocation(String).

Specified by:
register in interface IResourceManager
Parameters:
name - a name that represents the resource
inputStream - a stream to read the content from

unregister

boolean unregister(java.lang.String name)
Unregisters the resource with the given name.

Specified by:
unregister in interface IResourceManager
Parameters:
name - the name that represents the resource. Must not be null.
Returns:
true if unregistering the resource was successful, false otherwise.

isRegistered

boolean isRegistered(java.lang.String name)
Determines whether the resource with the given name has been registered.

Specified by:
isRegistered in interface IResourceManager
Parameters:
name - filename which identifies the registered resource. The filename must be relative to a classpath root, e.g. a gif 'my.gif' located within the package 'org.eclipse.rap' is identified as 'org/eclipse/rap/my.gif'. Must not be null.
Returns:
if the resource is already registered

getLocation

java.lang.String getLocation(java.lang.String name)
Returns the location within the web-applications context where the resource will be available for download.

Specified by:
getLocation in interface IResourceManager
Parameters:
name - the name which identifies the registered resource
Returns:
the location where the resource will be available for download

getRegisteredContent

java.io.InputStream getRegisteredContent(java.lang.String name)
Returns the content of the registered resource with the given name.

Specified by:
getRegisteredContent in interface IResourceManager
Parameters:
name - the name of the resource, must not be null
Returns:
an input stream to the contents of the resource, or null if no such resource exists

Eclipse Remote Application Platform

Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.