public class ClassPathResource extends Object implements Comparable<ClassPathResource>, Resource
| 构造器和说明 |
|---|
ClassPathResource(String location,
ClassLoader classLoader)
Creates a new ClassPathResource.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(ClassPathResource o) |
boolean |
equals(Object o) |
boolean |
exists() |
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()
Return the location of this resource on disk.
|
int |
hashCode() |
byte[] |
loadAsBytes()
Return the context of this resource as a byte array.
|
String |
loadAsString(String encoding)
Return the content of this resource as a string.
|
String |
toString() |
public ClassPathResource(String location, ClassLoader classLoader)
location - The location of the resource on the classpath.classLoader - The ClassLoader to use.public String getLocation()
ResourcegetLocation 在接口中 Resourcepublic String getLocationOnDisk()
ResourcegetLocationOnDisk 在接口中 Resourcepublic String loadAsString(String encoding)
ResourceloadAsString 在接口中 Resourceencoding - The encoding to use.public byte[] loadAsBytes()
ResourceloadAsBytes 在接口中 Resourcepublic String getFilename()
ResourcegetFilename 在接口中 Resourcepublic boolean exists()
public int compareTo(ClassPathResource o)
compareTo 在接口中 Comparable<ClassPathResource>Copyright © 2019. All rights reserved.