Here you can find the source of toPath(String id)
static String toPath(String id)
//package com.java2s; /* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 */ public class Main { static String toPath(String id) { int length = id.length(); StringBuilder sb = new StringBuilder(length + 8); int start = 0; while (start < length) { int next = start + 4; int end = next; if (end > length) { end = length;// w w w . ja v a 2 s. c o m } sb.append(id.subSequence(start, end)); sb.append('/'); start = next; } return sb.toString(); } }