public interface Resource
| 限定符和类型 | 方法和说明 |
|---|---|
default boolean |
delete()
删除
|
List<Resource> |
dirs()
目录
|
default boolean |
exists()
判断是否存在
|
default void |
export(OutputStream os,
String... excludes)
处理导出
|
List<Resource> |
files(String suffix)
遍历文件
|
String |
getAbsolutePath()
获取所在位置
|
default Resource |
getDirectory(String name)
获取子目录
|
String |
getFilePath()
获取文件路径
|
Resource |
getResource(String name)
获取子资源
|
default boolean |
isDirectory()
判断是否是目录
|
default boolean |
mkdir()
创建目录
|
String |
name()
获取资源名
|
Resource |
parent()
父级资源
|
default void |
processExport(ZipOutputStream zos,
String path,
Resource directory,
List<Resource> resources,
List<String> excludes)
处理导出
|
byte[] |
read()
读取
|
default void |
readAll()
读取当前资源下的所有内容,主要是缓存作用。
|
default boolean |
readonly()
判断是否是只读
|
default boolean |
renameTo(Resource resource)
重命名
|
List<Resource> |
resources()
获取子资源集合
|
default String |
separator()
获取分隔符
|
default boolean |
write(byte[] bytes)
写入
|
default boolean |
write(String content)
写入
|
default boolean readonly()
default boolean exists()
default boolean isDirectory()
default boolean delete()
default boolean mkdir()
default boolean renameTo(Resource resource)
resource - 目标资源default boolean write(String content)
content - 写入的内容default boolean write(byte[] bytes)
bytes - 写入的内容default String separator()
default void processExport(ZipOutputStream zos, String path, Resource directory, List<Resource> resources, List<String> excludes) throws IOException
zos - zip 输出流path - 路径directory - 目录资源对象resources - 资源集合excludes - 排除的目录IOException - 处理过程中抛出的异常default void export(OutputStream os, String... excludes) throws IOException
os - 输出流excludes - 排除的目录IOException - 处理过程中抛出的异常byte[] read()
default void readAll()
String name()
Resource parent()
String getAbsolutePath()
String getFilePath()
Copyright © 2020–2021. All rights reserved.