org.broadleafcommerce.common.resource
public class GeneratedResource extends org.springframework.core.io.AbstractResource implements Serializable
ResourceHttpRequestHandler.
Note that this class intentionally does not subclass Spring's InMemoryResource and instead has copied
the fields here because InMemoryResource does not provide a default constructor. This causes issues when
deserializing an instance from disk (such as in a caching scenario that overflows from memory to disk).| Modifier and Type | Field and Description |
|---|---|
protected String |
description |
protected String |
hashRepresentation |
protected byte[] |
source |
protected long |
timeGenerated |
| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object res) |
String |
getDescription() |
String |
getFilename() |
String |
getHashRepresentation() |
InputStream |
getInputStream() |
int |
hashCode() |
long |
lastModified() |
void |
setHashRepresentation(String hashRepresentation) |
protected long timeGenerated
protected String hashRepresentation
protected final byte[] source
protected final String description
public GeneratedResource()
public GeneratedResource(byte[] source,
String description)
public String getFilename()
getFilename in interface org.springframework.core.io.ResourcegetFilename in class org.springframework.core.io.AbstractResourcepublic long lastModified()
throws IOException
lastModified in interface org.springframework.core.io.ResourcelastModified in class org.springframework.core.io.AbstractResourceIOExceptionpublic String getHashRepresentation()
public void setHashRepresentation(String hashRepresentation)
public String getDescription()
getDescription in interface org.springframework.core.io.Resourcepublic InputStream getInputStream() throws IOException
getInputStream in interface org.springframework.core.io.InputStreamSourceIOExceptionpublic int hashCode()
hashCode in class org.springframework.core.io.AbstractResourcepublic boolean equals(Object res)
equals in class org.springframework.core.io.AbstractResourceCopyright © 2015. All Rights Reserved.