Here you can find the source of sanitizeUri(String uri)
private static String sanitizeUri(String uri)
//package com.java2s; //License from project: Apache License public class Main { private static String sanitizeUri(String uri) { if (uri.endsWith("/")) { uri = uri.substring(0, uri.length() - 1); }/*from ww w . j a v a 2 s. co m*/ return uri.replaceAll("//", "/"); } }