From 49973354b22e8aba9cc71f83571020b0414c54e0 Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Thu, 13 Mar 2014 08:52:37 +0200 Subject: Fixed trailing slash trimming in VaadinPortletService. Change-Id: Ia9f6230219adfb1fcb29b88ad819e3209770e1fc --- shared/src/com/vaadin/shared/util/SharedUtil.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shared/src/com') diff --git a/shared/src/com/vaadin/shared/util/SharedUtil.java b/shared/src/com/vaadin/shared/util/SharedUtil.java index 80efe68d83..449685705f 100644 --- a/shared/src/com/vaadin/shared/util/SharedUtil.java +++ b/shared/src/com/vaadin/shared/util/SharedUtil.java @@ -44,4 +44,13 @@ public class SharedUtil implements Serializable { return o1.equals(o2); } + /** + * Trims trailing slashes (if any) from a string. + * @param value The string value to be trimmed. Cannot be null. + * @return String value without trailing slashes. + */ + public static String trimTrailingSlashes(String value) { + return value.replaceAll("/*$", ""); + } + } -- cgit v1.2.3