|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.settings.def.ResourceSettings
public class ResourceSettings
| Constructor Summary | |
|---|---|
ResourceSettings(Application application)
Configures Wicket's default ResourceLoaders. |
|
| Method Summary | |
|---|---|
void |
addResourceFactory(String name,
IResourceFactory resourceFactory)
Adds a resource factory to the list of factories to consult when generating resources automatically |
void |
addResourceFolder(String resourceFolder)
Convenience method that sets the resource search path to a single folder. use when searching for resources. |
IResourceCachingStrategy |
getCachingStrategy()
gets the resource caching strategy |
ICssCompressor |
getCssCompressor()
Get the CSS compressor to remove comments and whitespace characters from css resources |
Duration |
getDefaultCacheDuration()
Get the the default cache duration for resources. |
IFileCleaner |
getFileCleaner()
|
IJavaScriptCompressor |
getJavaScriptCompressor()
Get the javascript compressor to remove comments and whitespace characters from javascripts |
Localizer |
getLocalizer()
Get the application's localizer. |
IPackageResourceGuard |
getPackageResourceGuard()
Gets the package resource guard. |
String |
getParentFolderPlaceholder()
Placeholder string for '..' within resource urls (which will be crippled by the browser and not work anymore). |
IPropertiesFactory |
getPropertiesFactory()
Get the property factory which will be used to load property files |
IResourceFactory |
getResourceFactory(String name)
|
IResourceFinder |
getResourceFinder()
Gets the resource finder to use when searching for resources. |
Duration |
getResourcePollFrequency()
|
IResourceStreamLocator |
getResourceStreamLocator()
|
IModificationWatcher |
getResourceWatcher(boolean start)
|
List<IStringResourceLoader> |
getStringResourceLoaders()
|
boolean |
getThrowExceptionOnMissingResource()
|
boolean |
getUseDefaultOnMissingResource()
|
void |
setCachingStrategy(IResourceCachingStrategy strategy)
sets the resource caching strategy |
ICssCompressor |
setCssCompressor(ICssCompressor compressor)
Set the CSS compressor implemententation use e.g. by CssPackageResource. |
void |
setDefaultCacheDuration(Duration duration)
Set the the default cache duration for resources. |
void |
setFileCleaner(IFileCleaner fileUploadCleaner)
Sets a cleaner that can be used to remove files asynchronously. |
IJavaScriptCompressor |
setJavaScriptCompressor(IJavaScriptCompressor compressor)
Set the javascript compressor implemententation use e.g. by JavaScriptPackageResource. |
void |
setLocalizer(Localizer localizer)
Sets the localizer which will be used to find property values. |
void |
setPackageResourceGuard(IPackageResourceGuard packageResourceGuard)
Sets the package resource guard. |
void |
setParentFolderPlaceholder(String sequence)
Placeholder string for '..' within resource urls (which will be crippled by the browser and not work anymore). |
void |
setPropertiesFactory(IPropertiesFactory factory)
Set the property factory which will be used to load property files |
void |
setResourceFinder(IResourceFinder resourceFinder)
Sets the finder to use when searching for resources. |
void |
setResourcePollFrequency(Duration resourcePollFrequency)
Sets the resource polling frequency. |
void |
setResourceStreamLocator(IResourceStreamLocator resourceStreamLocator)
Sets the resource stream locator for this application Consider wrapping resourceStreamLocator in CachingResourceStreamLocator. |
void |
setResourceWatcher(IModificationWatcher watcher)
Sets the resource watcher |
void |
setThrowExceptionOnMissingResource(boolean throwExceptionOnMissingResource)
|
void |
setUseDefaultOnMissingResource(boolean useDefaultOnMissingResource)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceSettings(Application application)
FooApplication let bar.Foo extend Component, this
results in the following ordering:
application - | Method Detail |
|---|
public void addResourceFactory(String name,
IResourceFactory resourceFactory)
IResourceSettings
addResourceFactory in interface IResourceSettingsname - The name to give to the factoryresourceFactory - The resource factory to addIResourceSettings.addResourceFactory(java.lang.String,
org.apache.wicket.IResourceFactory)public void addResourceFolder(String resourceFolder)
IResourceSettings
addResourceFolder in interface IResourceSettingsresourceFolder - The resourceFolder to setIResourceSettings.addResourceFolder(java.lang.String)public Localizer getLocalizer()
IPropertiesFactoryContextIResourceSettings.getStringResourceLoaders().
getLocalizer in interface IPropertiesFactoryContextIPropertiesFactoryContext.getLocalizer()public IPackageResourceGuard getPackageResourceGuard()
IResourceSettingspackage resource guard.
getPackageResourceGuard in interface IResourceSettingsIResourceSettings.getPackageResourceGuard()public IPropertiesFactory getPropertiesFactory()
IResourceSettings
getPropertiesFactory in interface IResourceSettingsIResourceSettings.getPropertiesFactory()public IResourceFactory getResourceFactory(String name)
getResourceFactory in interface IResourceSettingsname - Name of the factory to get
IResourceSettings.getResourceFactory(java.lang.String)public IResourceFinder getResourceFinder()
IResourceSettings
getResourceFinder in interface IResourceSettingsIResourceSettings.getResourceFinder()public Duration getResourcePollFrequency()
getResourcePollFrequency in interface IResourceSettingsIResourceSettings.getResourcePollFrequency()public IResourceStreamLocator getResourceStreamLocator()
getResourceStreamLocator in interface IPropertiesFactoryContextIPropertiesFactoryContext.getResourceStreamLocator()public IModificationWatcher getResourceWatcher(boolean start)
getResourceWatcher in interface IPropertiesFactoryContextstart - boolean if the resource watcher should be started if not already started.
IPropertiesFactoryContext.getResourceWatcher(boolean)public void setResourceWatcher(IModificationWatcher watcher)
IResourceSettings
setResourceWatcher in interface IResourceSettingsIResourceSettings.setResourceWatcher(org.apache.wicket.util.watch.IModificationWatcher)public IFileCleaner getFileCleaner()
getFileCleaner in interface IResourceSettingspublic void setFileCleaner(IFileCleaner fileUploadCleaner)
IResourceSettingsUsed internally to delete the temporary files created by FileUpload functionality
setFileCleaner in interface IResourceSettingsfileUploadCleaner - the actual cleaner implementation. Can be nullpublic List<IStringResourceLoader> getStringResourceLoaders()
getStringResourceLoaders in interface IResourceSettingsIResourceSettings.getStringResourceLoaders()public boolean getThrowExceptionOnMissingResource()
getThrowExceptionOnMissingResource in interface IResourceSettingsIResourceSettings.getThrowExceptionOnMissingResource()public boolean getUseDefaultOnMissingResource()
getUseDefaultOnMissingResource in interface IResourceSettingsIResourceSettings.getUseDefaultOnMissingResource()public void setLocalizer(Localizer localizer)
IResourceSettings
setLocalizer in interface IResourceSettingsIResourceSettings.setLocalizer(org.apache.wicket.Localizer)public void setPackageResourceGuard(IPackageResourceGuard packageResourceGuard)
IResourceSettingspackage resource guard.
setPackageResourceGuard in interface IResourceSettingspackageResourceGuard - The package resource guardIResourceSettings.setPackageResourceGuard(org.apache.wicket.markup.html.IPackageResourceGuard)public void setPropertiesFactory(IPropertiesFactory factory)
IResourceSettings
setPropertiesFactory in interface IResourceSettingsIResourceSettings.setPropertiesFactory(org.apache.wicket.resource.IPropertiesFactory)public void setResourceFinder(IResourceFinder resourceFinder)
IResourceSettings
setResourceFinder in interface IResourceSettingsresourceFinder - The resourceFinder to setIResourceSettings.setResourceFinder(org.apache.wicket.util.file.IResourceFinder)public void setResourcePollFrequency(Duration resourcePollFrequency)
IResourceSettings
setResourcePollFrequency in interface IResourceSettingsresourcePollFrequency - Frequency at which to poll resources or null if polling should be
disabledIResourceSettings.setResourcePollFrequency(org.apache.wicket.util.time.Duration)public void setResourceStreamLocator(IResourceStreamLocator resourceStreamLocator)
resourceStreamLocator in CachingResourceStreamLocator.
This way the locator will not be asked more than once for IResourceStreams which do
not exist.
setResourceStreamLocator in interface IResourceSettingsresourceStreamLocator - new resource stream locatorgetResourceStreamLocator()public void setThrowExceptionOnMissingResource(boolean throwExceptionOnMissingResource)
setThrowExceptionOnMissingResource in interface IResourceSettingsIResourceSettings.setThrowExceptionOnMissingResource(boolean)public void setUseDefaultOnMissingResource(boolean useDefaultOnMissingResource)
setUseDefaultOnMissingResource in interface IResourceSettingsuseDefaultOnMissingResource - Whether to use a default value (if available) when a missing resource is requestedIResourceSettings.setUseDefaultOnMissingResource(boolean)public final Duration getDefaultCacheDuration()
IResourceSettings
getDefaultCacheDuration in interface IResourceSettingsIResourceSettings.getDefaultCacheDuration()public final void setDefaultCacheDuration(Duration duration)
IResourceSettings
setDefaultCacheDuration in interface IResourceSettingsduration - default cache duration in secondsIResourceSettings.setDefaultCacheDuration(org.apache.wicket.util.time.Duration)public IJavaScriptCompressor getJavaScriptCompressor()
IResourceSettings
getJavaScriptCompressor in interface IResourceSettingsJavaScriptPackageResource. Null is a valid value.public IJavaScriptCompressor setJavaScriptCompressor(IJavaScriptCompressor compressor)
IResourceSettingsJavaScriptPackageResource. A typical implementation will remove comments and whitespace. But
a no-op implementation is available as well.
setJavaScriptCompressor in interface IResourceSettingscompressor - The implementation to be used
public ICssCompressor getCssCompressor()
IResourceSettings
getCssCompressor in interface IResourceSettingsCssPackageResource. Null is a valid value.public ICssCompressor setCssCompressor(ICssCompressor compressor)
IResourceSettingsCssPackageResource. A typical
implementation will remove comments and whitespace. But a no-op implementation is available
as well.
setCssCompressor in interface IResourceSettingscompressor - The implementation to be used
public String getParentFolderPlaceholder()
IResourceSettings::. Resources
are protected by a IPackageResourceGuard implementation such as
PackageResourceGuard which you may use or extend based
on your needs.
getParentFolderPlaceholder in interface IResourceSettingsIResourceSettings.getParentFolderPlaceholder()public void setParentFolderPlaceholder(String sequence)
IResourceSettingsnull and thus
will not allow to access parent folders. That is by purpose and for security reasons (see
Wicket-1992). In case you really need it, a good value for placeholder would e.g. be "$up$".
Resources additionally are protected by a
IPackageResourceGuard
implementation such as PackageResourceGuard which you
may use or extend based on your needs.
setParentFolderPlaceholder in interface IResourceSettingssequence - character sequence which must not be ambiguous within urlsIResourceSettings.setParentFolderPlaceholder(String)public IResourceCachingStrategy getCachingStrategy()
IResourceSettings
getCachingStrategy in interface IResourceSettingsIResourceSettings.getCachingStrategy()public void setCachingStrategy(IResourceCachingStrategy strategy)
IResourceSettings
setCachingStrategy in interface IResourceSettingsstrategy - instance of resource caching strategyIResourceSettings.setCachingStrategy(org.apache.wicket.request.resource.caching.IResourceCachingStrategy)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||