打包成可执行jar。并删除无效的代码

master
zhanghai 2 years ago
parent e1915db378
commit 84b0adb168

@ -114,6 +114,12 @@ public class FenpanService {
File[] files = sourceFile.listFiles();
for (File file : files) {
//非图片模式,跳过。
if(!(file.getName().endsWith(".jpg") || file.getName().endsWith(".png")
|| file.getName().endsWith(".jpeg") || file.getName().endsWith(".tif")
|| file.getName().endsWith(".tiff"))){
continue;
}
try {
ImageInfo imageInfo = Imaging.getImageInfo(file);
int height = imageInfo.getHeight();
@ -188,9 +194,9 @@ public class FenpanService {
Pieces pieces = new Pieces(FileTypeEnum.JPG, o.getParentFile().getAbsolutePath(), o.getParentFile().getName());
allDirectory.add(pieces);
} else {
FileUtils.delete(new File(o.getAbsolutePath()));
System.out.println("请删除无效的文件:" + o.getAbsolutePath());
throw new RuntimeException("请删除无效的文件:" + o.getAbsolutePath());
}
break;
}

@ -182,7 +182,7 @@ public class MyApplication {
int returnValue = fileChooser.showOpenDialog(null);
if (returnValue == JFileChooser.APPROVE_OPTION) {
File selectedFile = fileChooser.getSelectedFile();
savePathField.setText(selectedFile.getAbsolutePath());
savePathField.setText(selectedFile.getAbsolutePath()+"/");
}
}
});

Loading…
Cancel
Save