net.wotonomy.web
Class WOResourceManager

java.lang.Object
  extended by net.wotonomy.web.WOResourceManager

public class WOResourceManager
extends java.lang.Object

Manages all resources vended by the application.

Version:
$Revision: 905 $
Author:
michael@mpowers.net, $Author: cgruber $

Constructor Summary
protected WOResourceManager()
          Constructor is only accessible to subclasses.
 
Method Summary
 byte[] bytesForResourceNamed(java.lang.String aFileName, java.lang.String aFrameworkName, net.wotonomy.foundation.NSArray aLanguagesList)
          Returns the raw data corresponding to the specified resource.
 java.lang.String contentTypeForResourceNamed(java.lang.String aResourcePath)
          Returns the content type corresponding to the specified resource.
 java.lang.String errorMessageUrlForResourceNamed(java.lang.String aResourceName, java.lang.String aFrameworkName)
          Returns a url to be used when errors occur while retrieving a resource.
 void flushDataCache()
          Clears all cached system-wide resource data.
 java.io.InputStream inputStreamForResourceNamed(java.lang.String aResourceName, java.lang.String aFrameworkName, net.wotonomy.foundation.NSArray aLanguagesList)
          Returns an input for the raw resource.
 java.lang.String pathForResourceNamed(java.lang.String aResourceName, java.lang.String aFrameworkName, net.wotonomy.foundation.NSArray aLanguagesList)
          Deprecated. Use inputStreamForResourceNamed instead.
 void removeDataForKey(java.lang.String aKey, WOSession aSession)
          Removes the data from the dynamic data cache for the specified session.
 void setData(net.wotonomy.foundation.NSData someData, java.lang.String key, java.lang.String type, WOSession aSession)
          Sets the data in the dynamic data cache for the specified session.
 java.lang.String stringForKey(java.lang.String aKey, java.lang.String aFileName, java.lang.String aDefaultValue, java.lang.String aFrameworkName, net.wotonomy.foundation.NSArray aLanguagesList)
          Returns a localized string from a property list for a given key.
 java.lang.String urlForResourceNamed(java.lang.String aResourceName, java.lang.String aFrameworkName, net.wotonomy.foundation.NSArray aLanguagesList, WORequest aRequest)
          Returns a url that invokes the resource manager for the specified resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WOResourceManager

protected WOResourceManager()
Constructor is only accessible to subclasses.

Method Detail

bytesForResourceNamed

public byte[] bytesForResourceNamed(java.lang.String aFileName,
                                    java.lang.String aFrameworkName,
                                    net.wotonomy.foundation.NSArray aLanguagesList)
Returns the raw data corresponding to the specified resource. Any data retrieved by this method will be placed in the resource manager's global cache.


contentTypeForResourceNamed

public java.lang.String contentTypeForResourceNamed(java.lang.String aResourcePath)
Returns the content type corresponding to the specified resource. This implementation recognizes gif, jpg, png, html, and xml extensions. Otherwise, "text/plain" is returned.


errorMessageUrlForResourceNamed

public java.lang.String errorMessageUrlForResourceNamed(java.lang.String aResourceName,
                                                        java.lang.String aFrameworkName)
Returns a url to be used when errors occur while retrieving a resource.


flushDataCache

public void flushDataCache()
Clears all cached system-wide resource data.


pathForResourceNamed

public java.lang.String pathForResourceNamed(java.lang.String aResourceName,
                                             java.lang.String aFrameworkName,
                                             net.wotonomy.foundation.NSArray aLanguagesList)
Deprecated. Use inputStreamForResourceNamed instead.

Returns the file-system path for the specified resource. Deprecated and not implemented.


removeDataForKey

public void removeDataForKey(java.lang.String aKey,
                             WOSession aSession)
Removes the data from the dynamic data cache for the specified session. If aSession is null, the data is removed from the application-wide data cache.


setData

public void setData(net.wotonomy.foundation.NSData someData,
                    java.lang.String key,
                    java.lang.String type,
                    WOSession aSession)
Sets the data in the dynamic data cache for the specified session. If aSession is null, the data is placed in the application-wide data cache. If the key is a system-generated key, the data will be removed by calling removeData() the next time it is requested.


stringForKey

public java.lang.String stringForKey(java.lang.String aKey,
                                     java.lang.String aFileName,
                                     java.lang.String aDefaultValue,
                                     java.lang.String aFrameworkName,
                                     net.wotonomy.foundation.NSArray aLanguagesList)
Returns a localized string from a property list for a given key. If the key doesn't exist, aDefaultValue is returned.


urlForResourceNamed

public java.lang.String urlForResourceNamed(java.lang.String aResourceName,
                                            java.lang.String aFrameworkName,
                                            net.wotonomy.foundation.NSArray aLanguagesList,
                                            WORequest aRequest)
Returns a url that invokes the resource manager for the specified resource.


inputStreamForResourceNamed

public java.io.InputStream inputStreamForResourceNamed(java.lang.String aResourceName,
                                                       java.lang.String aFrameworkName,
                                                       net.wotonomy.foundation.NSArray aLanguagesList)
Returns an input for the raw resource. Data returned by this method will not be put in the resource manager's global cache.



Copyright © 2006 null. All Rights Reserved.