Package org.miaixz.bus.core.io.resource
Class VfsResource
java.lang.Object
org.miaixz.bus.core.io.resource.VfsResource
- All Implemented Interfaces:
Resource
VFS资源封装
支持VFS 3.x on JBoss AS 6+,JBoss AS 7 and WildFly 8+
参考:org.springframework.core.io.VfsUtils
, Spring
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.core.io.resource.Resource
getReader, readBytes, readString, readString, writeTo
-
Constructor Details
-
VfsResource
构造- Parameters:
resource- org.jboss.vfs.VirtualFile实例对象
-
-
Method Details
-
exists
public boolean exists()VFS文件是否存在- Returns:
- 文件是否存在
-
getName
Description copied from interface:Resource获取资源名,例如文件资源的资源名为文件名 -
getUrl
Description copied from interface:Resource获得解析后的URL,无对应URL的返回null -
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:
- 是否变更
-
getLastModified
public long getLastModified()获得VFS文件最后修改时间- Returns:
- 最后修改时间
-
size
public long size()获取VFS文件大小 -
getFile
获取物理文件对象- Returns:
- 物理文件对象
-