public final class ServletResource extends AbstractResource
URL_PREFIX_CLASSPATH, URL_PREFIX_FILE, URL_PREFIX_JAR, URL_PREFIX_ZIP, URL_PROTOCOL_FILE, URL_PROTOCOL_JAR, URL_PROTOCOL_VFS, URL_PROTOCOL_ZIP, URL_SEPARATOR_JAR| Constructor and Description |
|---|
ServletResource(javax.servlet.ServletContext sc,
String path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exist()
是否存在
|
File |
getFile()
文件对象.
|
URL |
getURL()
URL 对象.
|
boolean |
isDirectory()
是否是一个目录
|
boolean |
isFile()
是否是一个文件
|
long |
lastModified()
最后修改时间.
|
long |
length()
文件大小 (byte 长度).
|
InputStream |
openStream()
打开文件输入流.
|
String |
toString() |
getFileName, getPath, getRelativePathName, getURI, setPath, setRelativePathName, toByteArray, toCharArray, toStringpublic ServletResource(javax.servlet.ServletContext sc,
String path)
public InputStream openStream() throws ResourceNotFoundException
ResourceResourceNotFoundExceptionpublic File getFile() throws ResourceNotFoundException
ResourcegetFile in interface ResourcegetFile in class AbstractResourceResourceNotFoundExceptionpublic URL getURL()
ResourcegetURL in interface ResourcegetURL in class AbstractResourcepublic boolean exist()
Resourceexist in interface Resourceexist in class AbstractResourcepublic boolean isDirectory()
ResourceisDirectory in interface ResourceisDirectory in class AbstractResourcepublic boolean isFile()
ResourceisFile in interface ResourceisFile in class AbstractResourcepublic long length()
Resourcelength in interface Resourcelength in class AbstractResourcepublic long lastModified()
ResourcelastModified in interface ResourcelastModified in class AbstractResourceCopyright © 2016 jetbrick. All rights reserved.