changeset 288:ffafe3e470fb

Servlet version 1.22b2 - fixed bug with filenames sans extensions
author robcast
date Mon, 18 Oct 2004 15:31:28 +0200
parents dd1e681924bf
children 1e7cb24f2406
files client/digitallibrary/WEB-INF/lib/DigilibServlet.jar servlet/src/digilib/io/DocuDirectory.java servlet/src/digilib/servlet/Scaler.java
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
Binary file client/digitallibrary/WEB-INF/lib/DigilibServlet.jar has changed
--- a/servlet/src/digilib/io/DocuDirectory.java	Mon Oct 18 15:30:49 2004 +0200
+++ b/servlet/src/digilib/io/DocuDirectory.java	Mon Oct 18 15:31:28 2004 +0200
@@ -413,12 +413,13 @@
 				return -1;
 			}
 		}
+		List fileList = list[fc];
 		// empty directory?
-		if (list[fc] == null) {
+		if (fileList == null) {
 			return -1;
 		}
 		// search for exact match
-		int idx = Collections.binarySearch(list[fc], fn);
+		int idx = Collections.binarySearch(fileList, fn);
 		if (idx >= 0) {
 			return idx;
 		} else {
@@ -426,18 +427,18 @@
 			idx = -idx - 1;
 			String fb = FileOps.basename(fn);
 			DocuDirent fs;
-			if ((idx < list.length)
-					&& (FileOps.basename(((DocuDirent) list[fc].get(idx))
+			if ((idx < fileList.size())
+					&& (FileOps.basename(((DocuDirent) fileList.get(idx))
 							.getName()).equals(fb))) {
 				// idx matches
 				return idx;
 			} else if ((idx > 0)
-					&& (FileOps.basename(((DocuDirent) list[fc].get(idx - 1))
+					&& (FileOps.basename(((DocuDirent) fileList.get(idx - 1))
 							.getName()).equals(fb))) {
 				// idx-1 matches
 				return idx - 1;
-			} else if ((idx + 1 < list.length)
-					&& (FileOps.basename(((DocuDirent) list[fc].get(idx - 1))
+			} else if ((idx + 1 < fileList.size())
+					&& (FileOps.basename(((DocuDirent) fileList.get(idx - 1))
 							.getName()).equals(fb))) {
 				// idx+1 matches
 				return idx + 1;
--- a/servlet/src/digilib/servlet/Scaler.java	Mon Oct 18 15:30:49 2004 +0200
+++ b/servlet/src/digilib/servlet/Scaler.java	Mon Oct 18 15:31:28 2004 +0200
@@ -60,7 +60,7 @@
 	private static final long serialVersionUID = -325080527268912852L;
 
 	// digilib servlet version (for all components)
-	public static final String dlVersion = "1.22b1";
+	public static final String dlVersion = "1.22b2";
 
 	// logger for accounting requests
 	Logger accountlog = Logger.getLogger("account.request");