类 DescriptiveResource
java.lang.Object
cn.taketoday.core.io.AbstractResource
cn.taketoday.core.io.DescriptiveResource
- 所有已实现的接口:
InputStreamSource,Resource
Simple
Resource implementation that holds a resource description
but does not point to an actually readable resource.
To be used as placeholder if a Resource argument is
expected by an API but not necessarily used for actual reading.
- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller, TODAY 2021/3/9 20:12
-
字段概要
从接口继承的字段 cn.taketoday.core.io.Resource
EMPTY_ARRAY -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanThis implementation compares the underlying description String.booleanexists()This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.Get the content of the resource as input stream.inthashCode()This implementation returns the hash code of the underlying description String.toString()Return a description for this resource, to be used for error output when working with the resource.从类继承的方法 cn.taketoday.core.io.AbstractResource
contentLength, createRelative, customizeConnection, customizeConnection, getFile, getFileForLastModifiedCheck, getName, getURI, getURL, isDirectory, isFile, isOpen, isReadable, lastModified, list, list从接口继承的方法 cn.taketoday.core.io.InputStreamSource
getReader, getReader, readableChannel
-
构造器详细资料
-
DescriptiveResource
Create a new DescriptiveResource.- 参数:
description- the resource description
-
-
方法详细资料
-
exists
public boolean exists()从类复制的说明:AbstractResourceThis implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.This will cover both directories and content resources.
- 指定者:
exists在接口中Resource- 覆盖:
exists在类中AbstractResource
-
getInputStream
从接口复制的说明:InputStreamSourceGet the content of the resource as input stream.- 返回:
- input stream of
Resourcecontent - 抛出:
IOException- If an input exception occurs
-
toString
从接口复制的说明:ResourceReturn a description for this resource, to be used for error output when working with the resource.Implementations are also encouraged to return this value from their
toStringmethod.- 指定者:
toString在接口中Resource- 覆盖:
toString在类中AbstractResource- 另请参阅:
-
equals
This implementation compares the underlying description String.- 覆盖:
equals在类中AbstractResource
-
hashCode
public int hashCode()This implementation returns the hash code of the underlying description String.- 覆盖:
hashCode在类中AbstractResource
-