org.springframework.core.io.Resource接口源码分析
来源:互联网 发布:上海ug编程培训 编辑:程序博客网 时间:2024/05/16 01:11
该接口继承了InputStreamSource接口
boolean exists();
返回该资源是否存在
boolean isReadable();
返回该资源是否是可读资源
boolean isOpen();
返回这个资源是否是一个开放流的句柄
URL getURL() throws IOException;
返回资源的URL,如果该资源URL无法解析,抛出IOException
URI getURI() throws IOException;
返回资源的URI,如果该资源URI无法解析,抛出IOException
File getFile() throws IOException;
获取该资源的文件,如果在完整的路径下无法获取或者资源无法使用则会抛出IOException
long contentLength() throws IOException;
获取该资源的大小,如果无法解析抛出IOException
long lastModified() throws IOException;
获取这个资源最后一次修改的时间戳,无法解析抛出异常
Resource createRelative(String relativePath) throws IOException;
根据相对路径获取资源句柄,无法获取抛出异常
String getFilename();
获取资源的文件名,例如:myfile.txt,仅仅只是路径的一部分,如果名称不纯在返回null
String getDescription();
返回这个资源的描述,在对资源操作的时候出错的时候使用该方法,它的所有实现类也应该复写这个方法
0 0
- org.springframework.core.io.Resource接口源码分析
- org.springframework.core.io.Resource接口源码分析
- org.springframework.core.io.InputStreamSource接口源码分析
- java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
- org.springframework.core.Ordered接口
- org.springframework.core.io包的类图
- java.lang.NoSuchMethodError: org.springframework.core.io.ResourceEditor错误
- java.lang.NoSuchMethodError: org.springframework.core.io.ResourceEditor错误
- org.springframework.core.CollectionFactory
- org.springframework.core.CollectionFactory
- org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [XXX.xml]';
- Spring-core-io-Resource
- org.osgi.core关键源码分析
- org.springframework.jdbc.core.JdbcTemplate
- org.springframework.core.NestedI…
- 解决: org.springframework.core.MethodClassKey
- org.springframework.core.convert.ConversionFailedException
- The type org.springframework.core.io.support.ResourcePatternResolver cannot be resolved. It is ind
- nginx 配置
- java 中打印跳棋盘(类似于九宫格)
- wave
- 【Boost】boost::shared_from_this值得注意的地方
- LeetCode OJ 198 House Robber
- org.springframework.core.io.Resource接口源码分析
- llvm之IR手册翻译(5)
- windows下一些常见常用的快捷键
- 打印杨辉三角形
- python_11(format、转义字符、连接字符、字符串操作函数、字符串反转)
- HQL语句大全(转) && getHibernateTemplate()常用方法
- 笔试中遇到的求质数
- iOS视图的生命周期
- 《The C Programming Language》读书笔记总结 <一>.基础篇