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() |
URL |
getURL() |
int |
hashCode() |
contentLength, getFile, getFile, getFileForLastModifiedCheck, isReadable, lastModified
getURI, isOpen, toString
public 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 boolean exists()
Resource
exists
in interface Resource
exists
in class AbstractFileResolvingResource
public InputStream getInputStream() throws IOException
IOException
public URL getURL() throws IOException
getURL
in interface Resource
getURL
in class AbstractResource
IOException
public Resource createRelative(String relativePath)
createRelative
in interface Resource
createRelative
in class AbstractResource
public String getFilename()
getFilename
in interface Resource
getFilename
in class AbstractResource
public String getDescription()
public boolean equals(Object obj)
equals
in class AbstractResource
public int hashCode()
hashCode
in class AbstractResource
Copyright © 2016. All Rights Reserved.