From 4bd69801ce250548716dc2cf2019a6d052c5e7e3 Mon Sep 17 00:00:00 2001 From: mbarbier Date: Thu, 28 Apr 2011 18:47:48 +0000 Subject: [PATCH] TestFileController.java: fixed a "d'oh!" --- .../vitro/webapp/controller/harvester/TestFileController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/harvester/TestFileController.java b/src/edu/cornell/mannlib/vitro/webapp/controller/harvester/TestFileController.java index 0bb3796b..3a89ab51 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/controller/harvester/TestFileController.java +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/harvester/TestFileController.java @@ -203,7 +203,6 @@ public class TestFileController extends FreemarkerHttpServlet { * the file name prior to the final "." symbol (if one exists). */ private String handleNameCollision(String filename, File directory) { - String path = directory.getPath(); String base = filename; String extension = ""; if(filename.contains(".")) { @@ -213,7 +212,7 @@ public class TestFileController extends FreemarkerHttpServlet { String renamed = filename; - for(int i = 1; new File(path + renamed).exists(); i++) { + for(int i = 1; new File(directory, renamed).exists(); i++) { renamed = base + " (" + String.valueOf(i) + ")" + extension; }