public class FileSystemResource extends Object implements Resource
Resource implementation.
The ResourceLoaderStrategy will auto instantiate this class if the DataLoader
annotation specifies the filePaths attribute to contain a FileSystem resource. For eg.
| Constructor and Description |
|---|
FileSystemResource(File file)
Construct a new FileSystemResource from the provided File instance
|
FileSystemResource(String path)
Construct a new FileSystemResource from the provided simple path
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Identifies whether the resource represented by this instance exists or not
|
File |
getFile()
Get the File object instance represented by this Resource
|
InputStream |
getInputStream()
Get the input stream represented by this resource
|
OutputStream |
getOutputStream()
Get the
OutputStream for the given resource |
String |
getPath() |
String |
getResourceName()
Return the name of the resource
|
URL |
getURL()
Gwet the URL represented by this resource
|
String |
toString() |
public FileSystemResource(String path)
path - the path where the file system resource residespublic FileSystemResource(File file)
file - representing the file system resourcepublic String getPath()
public boolean exists()
public InputStream getInputStream()
getInputStream in interface ResourceInputStreampublic URL getURL()
public File getFile()
public String getResourceName()
getResourceName in interface Resourcepublic OutputStream getOutputStream()
OutputStream for the given resourcegetOutputStream in interface ResourceOutputStreamCopyright © 2014. All rights reserved.