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) |
byte[] |
getBytes() |
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.Resource
getFilename
in class org.springframework.core.io.AbstractResource
public long lastModified() throws IOException
lastModified
in interface org.springframework.core.io.Resource
lastModified
in class org.springframework.core.io.AbstractResource
IOException
public String getHashRepresentation()
public void setHashRepresentation(String hashRepresentation)
public String getDescription()
getDescription
in interface org.springframework.core.io.Resource
public InputStream getInputStream() throws IOException
getInputStream
in interface org.springframework.core.io.InputStreamSource
IOException
public int hashCode()
hashCode
in class org.springframework.core.io.AbstractResource
public byte[] getBytes()
public boolean equals(Object res)
equals
in class org.springframework.core.io.AbstractResource
Copyright © 2022. All rights reserved.