com.ibm.xsp.webapp.resources
Class AbstractResourceProvider

java.lang.Object
  extended by com.ibm.xsp.webapp.resources.AbstractResourceProvider
All Implemented Interfaces:
ResourceProvider
Direct Known Subclasses:
DojoLibResourceProvider, FileResourceProvider, JavaResourceProvider, PlatformResourceProvider, URLResourceProvider

public abstract class AbstractResourceProvider
extends java.lang.Object
implements ResourceProvider

Useful superclass for Resource providers


Nested Class Summary
protected  class AbstractResourceProvider.AbstractResource
           
protected  class AbstractResourceProvider.FileResource
           
 
Field Summary
protected static java.lang.String BMP_FILE_EXT
           
protected static java.lang.String BMP_MIME_TYPE
           
protected static java.lang.String CSS_FILE_EXT
           
protected static java.lang.String CSS_MIME_TYPE
           
protected static java.lang.String GIF_FILE_EXT
           
protected static java.lang.String GIF_MIME_TYPE
           
static int GZIP_EXCLUDE
           
protected static java.lang.String JPEG_FILE_EXT
           
protected static java.lang.String JPEG_MIME_TYPE
           
protected static java.lang.String JPG_FILE_EXT
           
protected static java.lang.String JS_FILE_EXT
           
protected static java.lang.String JS_MIME_TYPE
           
static int MIN_GZIP_SIZE
           
protected static java.lang.String PNG_FILE_EXT
           
protected static java.lang.String PNG_MIME_TYPE
           
protected static java.lang.String TXT_FILE_EXT
           
protected static java.lang.String TXT_MIME_TYPE
           
protected static java.lang.String XBL_FILE_EXT
           
protected static java.lang.String XBL_MIME_TYPE
           
protected static java.lang.String XUL_FILE_EXT
           
protected static java.lang.String XUL_MIME_TYPE
           
 
Fields inherited from interface com.ibm.xsp.webapp.resources.ResourceProvider
DEFAULT_ENCODING, DEFAULT_GLOBAL_EXPIRES, DEFAULT_MODULE_EXPIRES, EXPIRES, IF_MODIFIED_SINCE, LAST_MODIFIED, PARAM_CACHE
 
Constructor Summary
AbstractResourceProvider()
           
 
Method Summary
protected  long getDefaultExpireTime()
           
protected  java.lang.String getExpireProperty()
           
protected  long getExpireTime()
           
static java.lang.String getMimeType(java.lang.String fileName)
          Returns the mimeType of a given file
protected  boolean isHttpCache()
           
protected  long readExpirationProp(java.lang.String expProp)
           
protected  void setExpireTime(long expireTime)
           
protected  boolean shouldCacheResources()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xsp.webapp.resources.ResourceProvider
getResource
 

Field Detail

MIN_GZIP_SIZE

public static final int MIN_GZIP_SIZE
See Also:
Constant Field Values

GZIP_EXCLUDE

public static final int GZIP_EXCLUDE
See Also:
Constant Field Values

XBL_FILE_EXT

protected static final java.lang.String XBL_FILE_EXT
See Also:
Constant Field Values

XUL_FILE_EXT

protected static final java.lang.String XUL_FILE_EXT
See Also:
Constant Field Values

CSS_FILE_EXT

protected static final java.lang.String CSS_FILE_EXT
See Also:
Constant Field Values

TXT_FILE_EXT

protected static final java.lang.String TXT_FILE_EXT
See Also:
Constant Field Values

JS_FILE_EXT

protected static final java.lang.String JS_FILE_EXT
See Also:
Constant Field Values

BMP_FILE_EXT

protected static final java.lang.String BMP_FILE_EXT
See Also:
Constant Field Values

GIF_FILE_EXT

protected static final java.lang.String GIF_FILE_EXT
See Also:
Constant Field Values

PNG_FILE_EXT

protected static final java.lang.String PNG_FILE_EXT
See Also:
Constant Field Values

JPG_FILE_EXT

protected static final java.lang.String JPG_FILE_EXT
See Also:
Constant Field Values

JPEG_FILE_EXT

protected static final java.lang.String JPEG_FILE_EXT
See Also:
Constant Field Values

XBL_MIME_TYPE

protected static final java.lang.String XBL_MIME_TYPE
See Also:
Constant Field Values

XUL_MIME_TYPE

protected static final java.lang.String XUL_MIME_TYPE
See Also:
Constant Field Values

CSS_MIME_TYPE

protected static final java.lang.String CSS_MIME_TYPE
See Also:
Constant Field Values

TXT_MIME_TYPE

protected static final java.lang.String TXT_MIME_TYPE
See Also:
Constant Field Values

JS_MIME_TYPE

protected static final java.lang.String JS_MIME_TYPE
See Also:
Constant Field Values

BMP_MIME_TYPE

protected static final java.lang.String BMP_MIME_TYPE
See Also:
Constant Field Values

GIF_MIME_TYPE

protected static final java.lang.String GIF_MIME_TYPE
See Also:
Constant Field Values

PNG_MIME_TYPE

protected static final java.lang.String PNG_MIME_TYPE
See Also:
Constant Field Values

JPEG_MIME_TYPE

protected static final java.lang.String JPEG_MIME_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractResourceProvider

public AbstractResourceProvider()
Method Detail

readExpirationProp

protected long readExpirationProp(java.lang.String expProp)

getExpireTime

protected long getExpireTime()

setExpireTime

protected void setExpireTime(long expireTime)

getDefaultExpireTime

protected long getDefaultExpireTime()

getExpireProperty

protected java.lang.String getExpireProperty()

isHttpCache

protected boolean isHttpCache()

shouldCacheResources

protected boolean shouldCacheResources()

getMimeType

public static java.lang.String getMimeType(java.lang.String fileName)
Returns the mimeType of a given file

Returns:
mimeType