public class DefaultFileResource extends Object implements FileResource, Serializable
| Constructor and Description |
|---|
DefaultFileResource(File resourceFile) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Deprecated.
use ByteString class instead.
|
ByteString |
getByteString()
Return the resource as a byte array's clone.
|
String |
getContentType()
Get the content content type of the resource, for example image/jpeg.
|
String |
getExtension()
Returns the normalised extension for this resource, e.g.
|
File |
getFile() |
InputStream |
getInputStream()
Create an input stream for this resource.
|
long |
getSize()
Return size of the resource in bytes.
|
String |
getUriAsString()
Returns the uri (and hence a unique identifier) for a resource as a String.
|
void |
setContentType(String contentType) |
String |
toString() |
public DefaultFileResource(File resourceFile)
public File getFile()
getFile in interface FileResourcepublic String getUriAsString()
UriResourcegetUriAsString in interface UriResourcepublic InputStream getInputStream() throws IOException
ResourcegetInputStream in interface ResourceIOException@Deprecated public byte[] getBytes() throws IOException
getBytes in interface ResourceIOExceptionpublic ByteString getByteString() throws IOException
ResourcegetByteString in interface ResourceIOExceptionpublic long getSize()
throws IOException
ResourcegetSize in interface ResourceIOExceptionpublic String getContentType()
ResourcegetContentType in interface Resourcepublic void setContentType(String contentType)
public String getExtension()
ResourcegetExtension in interface ResourceCopyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries