提交 bda3d81b 编写于 作者: J Juergen Hoeller

implement file resolution for isReadable() as well

上级 2b4e714c
......@@ -110,6 +110,24 @@ public abstract class AbstractFileResolvingResource extends AbstractResource {
}
}
@Override
public boolean isReadable() {
try {
URL url = getURL();
if (ResourceUtils.isFileURL(url)) {
// Proceed with file system resolution...
File file = getFile();
return (file.canRead() && !file.isDirectory());
}
else {
return true;
}
}
catch (IOException ex) {
return false;
}
}
@Override
public int contentLength() throws IOException {
URL url = getURL();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册