Here you can find the source of normalizePath(String path)
public static String normalizePath(String path)
//package com.java2s; /**/*from w ww .j av a2 s . c om*/ * SlingBeans - NetBeans Sling plugin * https://github.com/jkan997/SlingBeans * Licensed under Apache 2.0 license * http://www.apache.org/licenses/LICENSE-2.0 */ public class Main { public static String normalizePath(String path) { return normalizePath(path, false); } public static String normalizePath(String path, boolean absolute) { path = path.trim(); if (path.startsWith("/")) { if (!absolute) { path = path.substring(1); } } else { if (absolute) { path = "/" + path; } } if (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } return path; } }