public static final class FileFinder.ResourceEntry 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 |
|---|
ResourceEntry(Resource resource,
String qualifiedJavaName,
String relativePathName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exist()
是否存在
|
File |
getFile()
文件对象.
|
String |
getFileName()
文件名(不包含路径)
|
String |
getQualifiedJavaName() |
URI |
getURI()
URI 对象.
|
URL |
getURL()
URL 对象.
|
boolean |
isDirectory()
是否是一个目录
|
boolean |
isFile()
是否是一个文件
|
boolean |
isJavaClass() |
long |
lastModified()
最后修改时间.
|
long |
length()
文件大小 (byte 长度).
|
InputStream |
openStream()
打开文件输入流.
|
byte[] |
toByteArray()
获取文件内容.
|
char[] |
toCharArray(Charset charset)
获取文件内容.
|
String |
toString() |
String |
toString(Charset charset)
获取文件内容.
|
getPath, getRelativePathName, setPath, setRelativePathNamepublic InputStream openStream() throws ResourceNotFoundException
ResourceResourceNotFoundExceptionpublic byte[] toByteArray()
throws ResourceNotFoundException
ResourcetoByteArray in interface ResourcetoByteArray in class AbstractResourceResourceNotFoundExceptionpublic char[] toCharArray(Charset charset) throws ResourceNotFoundException
ResourcetoCharArray in interface ResourcetoCharArray in class AbstractResourceResourceNotFoundExceptionpublic String toString(Charset charset) throws ResourceNotFoundException
ResourcetoString in interface ResourcetoString in class AbstractResourceResourceNotFoundExceptionpublic File getFile()
ResourcegetFile in interface ResourcegetFile in class AbstractResourcepublic URI getURI()
ResourcegetURI in interface ResourcegetURI in class AbstractResourcepublic 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 String getFileName()
ResourcegetFileName in interface ResourcegetFileName in class AbstractResourcepublic long length()
Resourcelength in interface Resourcelength in class AbstractResourcepublic long lastModified()
ResourcelastModified in interface ResourcelastModified in class AbstractResourcepublic String getQualifiedJavaName()
public boolean isJavaClass()
Copyright © 2016 jetbrick. All rights reserved.