Java Utililty Methods Path Level

List of utility methods to do Path Level

  1. HOME
  2. Java
  3. P
  4. Path Level

Description

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

Method

String getParentPath(String path)
Get the parent path of a file.
String parentPath = null;
File file = new File(path);
parentPath = file.getParent();
return parentPath;
String getParentPath(String path)
Extracts the parent of a file
int pos = path.lastIndexOf(File.separator);
if (pos <= 0) {
 return null;
return path.substring(0, pos);

AltStyle によって変換されたページ (->オリジナル) /