类 AbstractResource
- java.lang.Object
-
- cc.shacocloud.mirage.utils.resource.AbstractResource
-
-
构造器概要
构造器 构造器 说明 AbstractResource()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 longcontentLength()此方法读取整个输入流以确定内容长度booleanequals(@Nullable Object other)此实现比较说明字符串booleanexists()此实现检查是否可以打开文件,回退到是否可以打开输入流,这将涵盖目录和内容资源FilegetFile()假定资源无法解析为绝对文件路径。protected @NotNull FilegetFileForLastModifiedCheck()确定用于时间戳检查的文件URLgetURL()假定资源无法解析为 URL。inthashCode()此实现返回说明的哈希代码longlastModified()此实现检查基础文件的时间戳(如果可用)StringtoString()此实现返回此资源的说明-
从接口继承的方法 cc.shacocloud.mirage.utils.resource.Resource
getDescription, getPath, getReader, getStream, isFile, isReadable
-
-
-
-
方法详细资料
-
getURL
public URL getURL() throws IOException
假定资源无法解析为 URL。- 指定者:
getURL在接口中Resource- 返回:
- 解析后的
URL - 抛出:
IOException- 如果资源无法解析为 URL,即资源不能用作描述符
-
getFile
public File getFile() throws IOException
假定资源无法解析为绝对文件路径。- 指定者:
getFile在接口中Resource- 抛出:
java.io.FileNotFoundException- 如果资源无法解析为绝对文件路径,即资源在文件系统中不可用IOException- 另请参阅:
Resource.getStream()
-
contentLength
public long contentLength() throws IOException此方法读取整个输入流以确定内容长度强烈建议使用更优化的实现来覆盖此方法,例如检查文件长度,或者如果流只能读取一次,则可能只返回 -1。
- 指定者:
contentLength在接口中Resource- 抛出:
IOException- 另请参阅:
Resource.getStream()
-
lastModified
public long lastModified() throws IOException此实现检查基础文件的时间戳(如果可用)- 指定者:
lastModified在接口中Resource- 抛出:
IOException- 另请参阅:
getFileForLastModifiedCheck()
-
getFileForLastModifiedCheck
@NotNull protected @NotNull File getFileForLastModifiedCheck() throws IOException
确定用于时间戳检查的文件默认实现委托给
getFile().- 返回:
- 用于时间戳检查的文件
- 抛出:
IOException
-
equals
public boolean equals(@Nullable @Nullable Object other)此实现比较说明字符串- 覆盖:
equals在类中Object- 另请参阅:
Resource.getDescription()
-
hashCode
public int hashCode()
此实现返回说明的哈希代码- 覆盖:
hashCode在类中Object- 另请参阅:
Resource.getDescription()
-
toString
public String toString()
此实现返回此资源的说明- 覆盖:
toString在类中Object- 另请参阅:
Resource.getDescription()
-
-