public class UrlResource 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 |
|---|
UrlResource(URL url) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exist()
是否存在
|
URL |
getURL()
URL 对象.
|
boolean |
isDirectory()
是否是一个目录
|
boolean |
isFile()
是否是一个文件
|
long |
lastModified()
最后修改时间.
|
long |
length()
文件大小 (byte 长度).
|
InputStream |
openStream()
打开文件输入流.
|
String |
toString() |
getFile, getFileName, getPath, getRelativePathName, getURI, setPath, setRelativePathName, toByteArray, toCharArray, toStringpublic UrlResource(URL url)
public InputStream openStream() throws ResourceNotFoundException
ResourceResourceNotFoundExceptionpublic 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.