public class ClassPathResource extends AbstractFileResolvingResource
| Modifier | Constructor and Description |
|---|---|
|
ClassPathResource(String path) |
|
ClassPathResource(String path,
Class<?> clazz) |
|
ClassPathResource(String path,
ClassLoader classLoader) |
protected |
ClassPathResource(String path,
ClassLoader classLoader,
Class<?> clazz) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
createRelative(String relativePath) |
boolean |
equals(Object obj) |
boolean |
exists()
Whether the resource exists on the classpath
|
ClassLoader |
getClassLoader() |
String |
getDescription() |
String |
getFilename() |
InputStream |
getInputStream() |
String |
getPath() |
File |
getTempFileFromArchive()
Get a temp file from the classpath.
|
URL |
getURL() |
int |
hashCode() |
contentLength, getFile, getFile, getFileForLastModifiedCheck, isReadable, lastModifiedgetURI, isOpen, toStringpublic ClassPathResource(String path)
public ClassPathResource(String path, ClassLoader classLoader)
protected ClassPathResource(String path, ClassLoader classLoader, Class<?> clazz)
public final String getPath()
public final ClassLoader getClassLoader()
public File getTempFileFromArchive() throws IOException
IOExceptionpublic boolean exists()
Resourceexists in interface Resourceexists in class AbstractFileResolvingResourcepublic InputStream getInputStream() throws IOException
IOExceptionpublic URL getURL() throws IOException
getURL in interface ResourcegetURL in class AbstractResourceIOExceptionpublic Resource createRelative(String relativePath)
createRelative in interface ResourcecreateRelative in class AbstractResourcepublic String getFilename()
getFilename in interface ResourcegetFilename in class AbstractResourcepublic String getDescription()
public boolean equals(Object obj)
equals in class AbstractResourcepublic int hashCode()
hashCode in class AbstractResourceCopyright © 2017. All Rights Reserved.