src/main/java/org/robotframework/remoteserver/servlet/RemoteServerServlet.java
private static String cleanPath(String path) {
        path = path == null ? "/" : path;
        if (!path.startsWith("/")) {
            path = "/" + path;
        }
        path = path.replaceAll("/+", "/");
        if (path.length() > 1 && path.endsWith("/")) {
            path = path.substring(0, path.length() - 1);
        }
        return path;
    }
private static String cleanPath(String path) {
        path = path == null ? "/" : path;
        if (!path.startsWith("/")) {
            path = "/" + path;
        }
        path = path.replaceAll("/+", "/");
        if (path.length() > 1 && path.endsWith("/")) {
            path = path.substring(0, path.length() - 1);
        }
        return path;
    }
private static String cleanPath ( String path ) { path = path == null ? "/" : path ; if ( ! path . startsWith ( "/" ) ) { path = "/" + path ; } path = path . replaceAll ( "/+" , "/" ) ; if ( path . length ( ) > 1 && path . endsWith ( "/" ) ) { path = path . substring ( 0 , path . length ( ) - 1 ) ; } return path ; }
Cleans up the path of an incoming request. Repeating /s are reduced to
one /. Trailing /s are removed. A <code>null</code> or empty path is
converted to /.

@param path
the path the client requested
@return cleaned up path
Cleans up the path of an incoming request . Repeating / s are reduced to one / . Trailing / s are removed . A <code > null< / code > or empty path is converted to / .