org.broadleafcommerce.common.resource
Class GeneratedResource

java.lang.Object
  extended by org.springframework.core.io.AbstractResource
      extended by org.springframework.security.util.InMemoryResource
          extended by org.broadleafcommerce.common.resource.GeneratedResource
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource

public class GeneratedResource
extends org.springframework.security.util.InMemoryResource

An in memory generated resource. This class also overrides some parent Spring AbstractResource methods to ensure compatibility with the ResourceHttpRequestHandler.

Author:
Andre Azzolini (apazzolini)

Field Summary
protected  String hashRepresentation
           
protected  long timeGenerated
           
 
Constructor Summary
GeneratedResource()
          Note: This constructor should not be explicitly used To properly allow for serialization, we must provide this no-arg constructor that will create a "dummy" GeneratedResource.
GeneratedResource(byte[] source, String description)
           
 
Method Summary
 String getFilename()
           
 String getHashRepresentation()
           
 long lastModified()
           
 void setHashRepresentation(String hashRepresentation)
           
 
Methods inherited from class org.springframework.security.util.InMemoryResource
equals, getDescription, getInputStream, hashCode
 
Methods inherited from class org.springframework.core.io.AbstractResource
contentLength, createRelative, exists, getFile, getFileForLastModifiedCheck, getURI, getURL, isOpen, isReadable, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

timeGenerated

protected long timeGenerated

hashRepresentation

protected String hashRepresentation
Constructor Detail

GeneratedResource

public GeneratedResource()
Note: This constructor should not be explicitly used To properly allow for serialization, we must provide this no-arg constructor that will create a "dummy" GeneratedResource. The appropriate fields will be set during deserialization.


GeneratedResource

public GeneratedResource(byte[] source,
                         String description)
Method Detail

getFilename

public String getFilename()
Specified by:
getFilename in interface org.springframework.core.io.Resource
Overrides:
getFilename in class org.springframework.core.io.AbstractResource

lastModified

public long lastModified()
                  throws IOException
Specified by:
lastModified in interface org.springframework.core.io.Resource
Overrides:
lastModified in class org.springframework.core.io.AbstractResource
Throws:
IOException

getHashRepresentation

public String getHashRepresentation()

setHashRepresentation

public void setHashRepresentation(String hashRepresentation)


Copyright © 2013. All Rights Reserved.