Browse Source

!19 兼容本地绝对路径文件获取(win、linux)

Merge pull request !19 from zhangxiaoxiao/master
pull/19/MERGE
陈精华 4 years ago committed by Gitee
parent
commit
cb21952155
  1. 2
      jodconverter-web/src/main/java/cn/keking/utils/DownloadUtils.java

2
jodconverter-web/src/main/java/cn/keking/utils/DownloadUtils.java

@ -56,7 +56,7 @@ public class DownloadUtils {
}
try {
URL url = new URL(urlStr);
if (url.getProtocol() != null && url.getProtocol().toLowerCase().startsWith("http")) {
if (url.getProtocol() != null && (url.getProtocol().toLowerCase().startsWith("file")||url.getProtocol().toLowerCase().startsWith("http"))) {
byte[] bytes = getBytesFromUrl(urlStr);
OutputStream os = new FileOutputStream(new File(realPath));
saveBytesToOutStream(bytes, os);

Loading…
Cancel
Save