Skip to content

Commit

Permalink
邮件支持 附件发送
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuCheng3y committed Feb 15, 2023
1 parent 7578887 commit 7c8b9e7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ public class AustinFileUtils {
*/
public static File getRemoteUrl2File(String path, String remoteUrl) {
try {
new File(path).mkdirs();
URL url = new URL(remoteUrl);
File file = new File(path, url.getPath());
IoUtil.copy(url.openStream(), new FileOutputStream(file));
if (!file.exists()) {
IoUtil.copy(url.openStream(), new FileOutputStream(file));
}
return file;
} catch (Exception e) {
log.error("AustinFileUtils#getRemoteUrl2File fail:{},remoteUrl:{}", Throwables.getStackTraceAsString(e), remoteUrl);
Expand Down

0 comments on commit 7c8b9e7

Please sign in to comment.