Here you can find the source of addLeadingSlash(String path)
Parameter | Description |
---|---|
path | the path |
public static String addLeadingSlash(String path)
//package com.java2s; //License from project: Apache License public class Main { /**/*from www . j a v a 2s . c o m*/ * Ensures the given chunk path starts with a leading slash * @param path the path * @return the path with leading slash */ public static String addLeadingSlash(String path) { if (path == null) { return null; } if (!path.isEmpty() && path.charAt(0) == '/') { return path; } return "/" + path; } }