From dfc4ece4083bbbb98f55291d05e7d2b1513464b7 Mon Sep 17 00:00:00 2001
From: Thomas Pummer <dev@nullpointer.at>
Date: Fri, 22 Feb 2013 11:10:11 -0500
Subject: [PATCH] the display-name in web.xml now shows the actual version of Gitblit

---
 src/com/gitblit/utils/FileUtils.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/com/gitblit/utils/FileUtils.java b/src/com/gitblit/utils/FileUtils.java
index 0834867..a21b512 100644
--- a/src/com/gitblit/utils/FileUtils.java
+++ b/src/com/gitblit/utils/FileUtils.java
@@ -274,4 +274,19 @@
 			return path.getAbsoluteFile();
 		}
 	}
+
+	public static File resolveParameter(String parameter, File aFolder, String path) {
+		if (aFolder == null) {
+			// strip any parameter reference		
+			path = path.replace(parameter, "").trim();
+			if (path.length() > 0 && path.charAt(0) == '/') {
+				// strip leading /
+				path = path.substring(1);
+			}
+		} else if (path.contains(parameter)) {
+			// replace parameter with path
+			path = path.replace(parameter, aFolder.getAbsolutePath());
+		}
+		return new File(path);
+	}
 }

--
Gitblit v1.9.1