public class FileSystemResource extends Object implements Resource, Comparable<FileSystemResource>
| 构造器和说明 |
|---|
FileSystemResource(String location)
Creates a new ClassPathResource.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(FileSystemResource o) |
String |
getFilename()
Return the filename of this resource, without the path.
|
String |
getLocation()
Return the location of the resource on the classpath (path and filename).
|
String |
getLocationOnDisk()
Retrieves the location of this resource on disk.
|
byte[] |
loadAsBytes()
Loads this resource as a byte array.
|
String |
loadAsString(String encoding)
Loads this resource as a string.
|
String |
toString() |
public FileSystemResource(String location)
location - The location of the resource on the filesystem.public String getLocation()
ResourcegetLocation 在接口中 Resourcepublic String getLocationOnDisk()
getLocationOnDisk 在接口中 Resourcepublic String loadAsString(String encoding)
loadAsString 在接口中 Resourceencoding - The encoding to use.public byte[] loadAsBytes()
loadAsBytes 在接口中 Resourcepublic String getFilename()
ResourcegetFilename 在接口中 Resourcepublic int compareTo(FileSystemResource o)
compareTo 在接口中 Comparable<FileSystemResource>Copyright © 2019. All rights reserved.