|
@@ -198,7 +198,7 @@ public class FileStorageUtil {
|
|
* @param localFilePath 例如D:/123.txt
|
|
* @param localFilePath 例如D:/123.txt
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- public static void saveUrlAs(String fileUrl, String localFilePath) throws IOException {
|
|
|
|
|
|
+ private static void saveUrlAs(String fileUrl, String localFilePath) throws IOException {
|
|
URL url = new URL(fileUrl);
|
|
URL url = new URL(fileUrl);
|
|
|
|
|
|
HttpURLConnection connection;
|
|
HttpURLConnection connection;
|
|
@@ -226,8 +226,12 @@ public class FileStorageUtil {
|
|
* @param localFile 本地文件对象
|
|
* @param localFile 本地文件对象
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- public static void saveUrlAs(String fileUrl, File localFile) throws IOException {
|
|
|
|
- saveUrlAs(fileUrl, localFile.getAbsoluteFile());
|
|
|
|
|
|
+ public static void saveUrlAs(String fileUrl, File localFile) {
|
|
|
|
+ try {
|
|
|
|
+ saveUrlAs(fileUrl, localFile.getAbsolutePath());
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ throw new StatusException("1001", "下载文件出错",e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**获取指定云存储的签名
|
|
/**获取指定云存储的签名
|