public class Resource extends Object
| 构造器和说明 |
|---|
Resource(String path) |
Resource(String path,
Class<?> clazz) |
Resource(String path,
ClassLoader classLoader) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
exists() |
ClassLoader |
getClassLoader()
Return the ClassLoader that this resource will be obtained from.
|
static ClassLoader |
getDefaultClassLoader() |
InputStream |
getInputStream()
This implementation opens an InputStream for the given class path
resource.
|
String |
getPath()
Return the path for this resource (as resource path within the class
path).
|
String |
getPhysicalwebapp() |
URL |
getURL() |
void |
setWebRoot(String webRoot) |
public Resource(String path)
public Resource(String path, ClassLoader classLoader)
public void setWebRoot(String webRoot)
public String getPhysicalwebapp() throws IOException
IOExceptionpublic static ClassLoader getDefaultClassLoader()
public boolean exists()
public InputStream getInputStream() throws IOException
public URL getURL() throws IOException
IOExceptionpublic final String getPath()
public final ClassLoader getClassLoader()
Copyright © 2018. All rights reserved.