Package org.aoju.bus.core.io.resource
Class MultiResource
java.lang.Object
org.aoju.bus.core.io.resource.MultiResource
-
Constructor Summary
ConstructorsConstructorDescriptionMultiResource(Collection<Resource> resources) 构造MultiResource(Resource... resources) 构造 -
Method Summary
Modifier and TypeMethodDescription增加资源getName()获取资源名,例如文件资源的资源名为文件名获得Reader获得InputStreamgetUrl()获得解析后的URLbooleanhasNext()boolean检查资源是否变更 一般用于文件类资源,检查文件是否被修改过iterator()next()byte[]读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取readString(Charset charset) 读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取voidremove()voidreset()重置游标Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
MultiResource
-
MultiResource
-
-
Method Details
-
getName
-
getUrl
-
getStream
Description copied from interface:Resource获得InputStream- Specified by:
getStreamin interfaceResource- Returns:
InputStream
-
isModified
public boolean isModified()Description copied from interface:Resource检查资源是否变更 一般用于文件类资源,检查文件是否被修改过- Specified by:
isModifiedin interfaceResource- Returns:
- 是否变更
-
getReader
Description copied from interface:Resource获得Reader- Specified by:
getReaderin interfaceResource- Parameters:
charset- 编码- Returns:
BufferedReader
-
readString
Description copied from interface:Resource读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取- Specified by:
readStringin interfaceResource- Parameters:
charset- 编码- Returns:
- 读取资源内容
- Throws:
InternalException- 包装IOException
-
readBytes
Description copied from interface:Resource读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取- Specified by:
readBytesin interfaceResource- Returns:
- 读取资源内容
- Throws:
InternalException- 包装IOException
-
iterator
-
hasNext
-
next
-
remove
-
reset
public void reset()重置游标 -
add
-