Skip to content

Commit

Permalink
Fix a display bug on TreeView
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed May 30, 2019
1 parent cb55392 commit db6ba80
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@ public URI getUri() {

public String getPath() {
if (strPath == null) {
if (rootNameCount == fsPath.getNameCount()) {
int nameCount = fsPath.getNameCount();

if (rootNameCount == nameCount) {
strPath = "";
} else {
strPath = fsPath.subpath(rootNameCount, fsPath.getNameCount()).toString();
if (strPath.endsWith(fsPath.getFileSystem().getSeparator())) {
strPath = fsPath.subpath(rootNameCount, nameCount).toString().replace(fsPath.getFileSystem().getSeparator(), "/");

int strPathLength = strPath.length();

if ((strPathLength > 0) && strPath.charAt(strPathLength-1) == '/') {
// Cut last separator
strPath = strPath.substring(0, strPath.length()-fsPath.getFileSystem().getSeparator().length());
strPath = strPath.substring(0, strPathLength-1);
}
}
}
Expand Down

0 comments on commit db6ba80

Please sign in to comment.