Java Utililty Methods Path Create

List of utility methods to do Path Create

Description

The list of methods to do Path Create are organized into topic(s).

Method

StringtoPath(String groupId)
to Path
final StringBuilder sb = new StringBuilder(groupId);
int length = sb.length();
for (int i = 0; i < length; i++) {
    if (sb.charAt(i) == '.') {
        sb.setCharAt(i, '/');
return sb.toString();
...
StringtoPath(String id)
to Path
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;
...
String[]toPath(String pathName)
Translates the given identifier path name into a corresponding sequence of identifiers.
return pathName == null ? null : pathName.split("\\.", -1);
StringtoPath(String srcPath, boolean nodeModelSource)
to Path
if (nodeModelSource) {
    StringBuilder builder = new StringBuilder();
    if (srcPath.startsWith("/") && srcPath.length() > 0) {
        srcPath = srcPath.substring(1);
    String[] tokens = srcPath.split("/");
    builder.append(".vars[\"").append(tokens[0]).append("\"]");
    if (tokens.length > 1) {
...
StringtoPath(String... paths)
to Path
StringBuilder builder = new StringBuilder();
for (String path : paths) {
    if (path.endsWith("/")) {
        path = path.substring(0, path.length() - 1);
    if (path.startsWith("/")) {
        builder.append(path);
    } else {
...
StringtoPath(String[] array)
to Path
if (array.length > 0) {
    StringBuilder sb = new StringBuilder(array[0]);
    for (int i = 1; i < array.length; i++) {
        sb.append(CPS).append(array[i]);
    return sb.toString();
} else
    return null;
...
inttoPathIndex(String fileName)
to Path Index
int point = fileName.indexOf('/');
if (point == -1) {
    point = fileName.indexOf('\\');
return point;
StringtoPathName(String name)
Converts a string into a valid path name
String result = "";
for (char c : name.toCharArray()) {
    if (!allowedChars.contains("" + c)) {
        result += "_" + ((int) c) + "_";
    } else {
        result += c;
return result;
StringtoPathPart(String fileName)
to Path Part
int point = toPathLsatIndex(fileName);
int length = fileName.length();
if (point == -1) {
    return "";
} else if (point == length - 1) {
    int secondPoint = toPathLsatIndex(fileName, point - 1);
    if (secondPoint == -1) {
        return "";
...
StringtoPathsFromArray(final String[] items)
to Paths From Array
if (items == null) {
    return "";
final StringBuilder dirStr = new StringBuilder(1024);
for (final String dir : items) {
    dirStr.append(dir).append(";");
return dirStr.toString();
...