|
|
|
@ -87,6 +87,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
private ScheduledDao scheduledDao;
|
|
|
|
|
|
|
|
|
|
private String imagePath = FileConstant.COMMON_FILE_PATH;
|
|
|
|
|
private String devImagePath = FileConstant.DEV_COMMON_FILE_PATH;
|
|
|
|
|
|
|
|
|
|
/*获取拉取任务列表*/
|
|
|
|
|
@Override
|
|
|
|
@ -1166,8 +1167,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean signleDownloadFile(String syncIp, String fileName) {
|
|
|
|
|
String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/";
|
|
|
|
|
if (!FileUtils.makeDirectory(filePath + filePathSlash + imagePath))
|
|
|
|
|
IDCUtils.createDirectory(filePath + filePathSlash + imagePath);
|
|
|
|
|
if (!FileUtils.makeDirectory(filePath + filePathSlash + devImagePath))
|
|
|
|
|
IDCUtils.createDirectory(filePath + filePathSlash + devImagePath);
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();
|
|
|
|
|
;
|
|
|
|
@ -1189,7 +1190,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
try (InputStream inputStream = result.body().byteStream()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath + fileName);
|
|
|
|
|
FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + devImagePath + fileName);
|
|
|
|
|
|
|
|
|
|
byte b[] = new byte[1024];
|
|
|
|
|
|
|
|
|
@ -1203,7 +1204,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
outputStream.flush();
|
|
|
|
|
outputStream.close();
|
|
|
|
|
if (!(total > 0)) {
|
|
|
|
|
new File(filePath + filePathSlash + imagePath + fileName).delete();
|
|
|
|
|
new File(filePath + filePathSlash + devImagePath + fileName).delete();
|
|
|
|
|
executeSql("delete from idc_file where filePath='" + fileName + "'");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|