From 2b48e4396468b51e8f330d856eccc0a398f46504 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 3 Sep 2004 10:34:45 +0000 Subject: [PATCH] Implement decent string representation for path object. --- src/helma/framework/core/RequestPath.java | 15 +++++++++++++++ src/helma/scripting/rhino/PathWrapper.java | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/helma/framework/core/RequestPath.java b/src/helma/framework/core/RequestPath.java index 86279422..199f0111 100644 --- a/src/helma/framework/core/RequestPath.java +++ b/src/helma/framework/core/RequestPath.java @@ -142,4 +142,19 @@ public class RequestPath { return objects.indexOf(obj); } + /** + * Return a string representation of the Request Path + */ + public String toString() { + // If there's just one element we're on the root object. + if (ids.size() <= 1) + return "/"; + + StringBuffer buffer = new StringBuffer(); + for (int i=1; i