邮件支持 附件发送

master
3y 2 years ago
parent 7578887b9c
commit 7c8b9e7b4a

@ -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);

Loading…
Cancel
Save