Java Path Create toPath(String id)

Here you can find the source of toPath(String id)

Description

to Path

License

Apache License

Declaration

static String toPath(String id) 

Method Source Code

//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();
    }
}

Related

  1. makePathRelativeTo(String path, final File basedir)
  2. makePaths(File path)
  3. toPath(Class klazz)
  4. toPath(Object[] path)
  5. toPath(String groupId)
  6. toPath(String pathName)
  7. toPath(String srcPath, boolean nodeModelSource)
  8. toPath(String... paths)
  9. toPath(String[] array)