Patch from https://bz.apache.org/bugzilla/show_bug.cgi?id=58347 - s/arg/filename for a more descriptive filename

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1702060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David North 2015-09-09 17:27:49 +00:00
parent aea434a135
commit 728e202b6b

View File

@ -33,11 +33,11 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class ReSave { public class ReSave {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
boolean initDrawing = false; boolean initDrawing = false;
for(String arg : args) { for(String filename : args) {
if(arg.equals("-dg")) initDrawing = true; if(filename.equals("-dg")) initDrawing = true;
else { else {
System.out.print("reading " + arg + "..."); System.out.print("reading " + filename + "...");
FileInputStream is = new FileInputStream(arg); FileInputStream is = new FileInputStream(filename);
HSSFWorkbook wb = new HSSFWorkbook(is); HSSFWorkbook wb = new HSSFWorkbook(is);
try { try {
System.out.println("done"); System.out.println("done");
@ -49,7 +49,7 @@ public class ReSave {
} }
} }
String outputFile = arg.replace(".xls", "-saved.xls"); String outputFile = filename.replace(".xls", "-saved.xls");
System.out.print("saving to " + outputFile + "..."); System.out.print("saving to " + outputFile + "...");
FileOutputStream out = new FileOutputStream(outputFile); FileOutputStream out = new FileOutputStream(outputFile);
try { try {