|
@@ -302,6 +302,12 @@ public class FileStorageUtil {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static void saveUrlAs(String fileUrl, File localFile) {
|
|
|
+ if (StringUtils.isBlank(fileUrl)) {
|
|
|
+ throw new StatusException("500","文件链接为空");
|
|
|
+ }
|
|
|
+ if (!fileUrl.toLowerCase().startsWith("http") && !fileUrl.toLowerCase().startsWith("https")) {
|
|
|
+ throw new StatusException("500","文件链接不是URL");
|
|
|
+ }
|
|
|
try {
|
|
|
saveUrlAs(fileUrl, localFile.getAbsolutePath());
|
|
|
} catch (IOException e) {
|