public class FileResource extends Object implements NamedResource
Constructor and Description |
---|
FileResource(File file)
Initialize the resource with the provided file.
|
FileResource(File file,
String name)
Initialize the resource with the provided file and name.
|
FileResource(String fileName)
Initialize the resource with the provided file.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
File |
getFile() |
InputStream |
getInputStream()
Stream that contains the template content.
|
String |
getName()
Get the name for the resource.
|
int |
hashCode() |
public FileResource(File file, String name)
file
- the content of the resourcename
- the name for the resourcepublic FileResource(File file)
file
- the content of the resourcepublic FileResource(String fileName)
fileName
- the content of the resourcepublic InputStream getInputStream() throws IOException
Resource
InputStream
is created. You MUST close the input stream after
using it.getInputStream
in interface Resource
IOException
- when the input stream can't be accessed or readpublic File getFile()
public String getName()
NamedResource
getName
in interface NamedResource
Copyright © 2017. All rights reserved.