PathUtils

Utility methods to handle paths. For example, get the name or the parent path. 

Methods

getParent

Description:

MethodReturn valuesDescription

getParent(String path)

String

Gets the parent node.

path: The path of the file.

Example:

import com.openkm.util.ContextWrapper;
import com.openkm.util.PathUtils;

try {
    System.out.println(PathUtils.getParent("/okm:root/logo.png"));
} catch (Exception e) {
    e.printStackTrace();
}

getName

Description:

MethodReturn valuesDescription

getName(String path)

String

Gets the node name.

path: The path of the file.

Example:

import com.openkm.util.ContextWrapper;
import com.openkm.util.PathUtils;

try {
    System.out.println(PathUtils.getName("/okm:root/logo.png"));
} catch (Exception e) {
    e.printStackTrace();
}

 

Table of contents [ Hide Show ]