diff servlet/src/digilib/io/DocuDirent.java @ 176:67ff8c7fecb9

Servlet version 1.17b2 - new mapping file for "virtual directories" - direct file URLs now work without extension (even with wrong ones)
author robcast
date Mon, 10 Nov 2003 20:59:00 +0100
parents e743b853efca
children afe7ff98bb71
line wrap: on
line diff
--- a/servlet/src/digilib/io/DocuDirent.java	Mon Nov 10 20:50:32 2003 +0100
+++ b/servlet/src/digilib/io/DocuDirent.java	Mon Nov 10 20:59:00 2003 +0100
@@ -78,7 +78,10 @@
 		}
 	}
 
-	/** The name of the (hires) image file.
+	/** The name of the file.
+	 * 
+	 * If this is a Fileset, the method returns the name of the default file 
+	 * (for image filesets the highest resolution file).
 	 * 
 	 * @return
 	 */
@@ -87,7 +90,19 @@
 		return (f != null) ? f.getName() : null;
 	}
 
-	/** Returns the parent DocuDirectory.
+	/** The filename sans extension.
+	 * 
+	 * @return
+	 */
+	public String getBasename() {
+		File f = getFile();
+		if (f == null) {
+			return null;
+		}
+		return FileOps.basename(f.getName());
+	}
+
+	/** Returns the parent Directory.
 	 * 
 	 * @return DocuDirectory
 	 */
@@ -95,15 +110,15 @@
 		return parent;
 	}
 
-	/**
-	 * Sets the parent.
+	/** Sets the parent Directory.
+	 * 
 	 * @param parent The parent to set
 	 */
 	public void setParent(Directory parent) {
 		this.parent = parent;
 	}
 
-	/** Returns the meta-data for this fileset.
+	/** Returns the meta-data for this file(set).
 	 * 
 	 * @return HashMap
 	 */
@@ -111,8 +126,8 @@
 		return fileMeta;
 	}
 
-	/**
-	 * Sets the fileMeta.
+	/** Sets the meta-data for this file(set)
+	 * .
 	 * @param fileMeta The fileMeta to set
 	 */
 	public void setFileMeta(HashMap fileMeta) {