net.northfuse.resources
Class ResourceHandlerImpl

java.lang.Object
  extended by net.northfuse.resources.ResourceHandlerImpl
All Implemented Interfaces:
ResourceHandler
Direct Known Subclasses:
ScriptResourceHandler, StyleResourceHandler

public abstract class ResourceHandlerImpl
extends java.lang.Object
implements ResourceHandler

Author:
tylers2

Method Summary
 org.springframework.core.io.Resource getAggregatedResource()
          Aggregates the resource, creating a new resource.
 java.lang.String getMapping()
          Gets the mapping of this resource.
 org.springframework.http.MediaType getMediaType()
          Gets the media type.
 void init()
          Initialize (cache) resource.
 boolean isDebug()
          Gets whether or not this is in debug mode.
 void setDebug(boolean debug)
          Sets debug mode.
 void setMapping(java.lang.String mapping)
          Sets the mapping.
 void setResourceGenerator(ResourceGenerator resourceGenerator)
          Sets the resource generator.
protected abstract  java.io.InputStream wrapWithMinify(java.io.InputStream is)
          Wraps the input stream with an input stream that minifies it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDebug

public final void setDebug(boolean debug)
Sets debug mode.

Parameters:
debug - Whether or not to enable debug mode

isDebug

public final boolean isDebug()
Gets whether or not this is in debug mode.

Specified by:
isDebug in interface ResourceHandler
Returns:
debug flag

getMapping

public final java.lang.String getMapping()
Gets the mapping of this resource.

Specified by:
getMapping in interface ResourceHandler
Returns:
The mapping

setMapping

public final void setMapping(java.lang.String mapping)
Sets the mapping.

Parameters:
mapping - The mapping

setResourceGenerator

public final void setResourceGenerator(ResourceGenerator resourceGenerator)
Sets the resource generator.

Parameters:
resourceGenerator - The resource generator

getAggregatedResource

public final org.springframework.core.io.Resource getAggregatedResource()
Aggregates the resource, creating a new resource.

Specified by:
getAggregatedResource in interface ResourceHandler
Returns:
a non-null resource

init

@PostConstruct
public final void init()
                throws java.io.IOException
Initialize (cache) resource.

Throws:
java.io.IOException - IOException

wrapWithMinify

protected abstract java.io.InputStream wrapWithMinify(java.io.InputStream is)
                                               throws java.io.IOException
Wraps the input stream with an input stream that minifies it.

Parameters:
is - The input stream to wrap
Returns:
A wrapped input stream
Throws:
java.io.IOException - If an io exception occurs.

getMediaType

public final org.springframework.http.MediaType getMediaType()
Gets the media type.

Specified by:
getMediaType in interface ResourceHandler
Returns:
A non-null media-type


Copyright © 2011. All Rights Reserved.