- 论坛徽章:
- 0
|
同样的代码:
public static void download(String file, String storePath) {
int start = file.indexOf("group");
String group = file.substring(start, start + 6);
String newFile = file.substring(start + 7);
download(group, newFile, storePath);
}
public static void download(String group, String file, String storePath) {
try {
byte[] data = storageClient.download_file(group, file);
File savefile = new File(storePath);
if (!savefile.exists()) {
savefile.mkdirs();
}
IOUtils.write(data, new FileOutputStream(new File(storePath + "/"
+ file.substring(file.lastIndexOf("/") + 1))));
LOGGER.info("~~download success~~");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("download exception");
}
}
连续执行两次,下载的图片一个能看,一个不能看。原本以为是下载的另一个-m的图片,但是删掉后还是一样的问题
|
|