File tree Expand file tree Collapse file tree
services/src/main/java/org/jd/gui/model/container Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,13 +87,18 @@ public URI getUri() {
8787
8888 public String getPath () {
8989 if (strPath == null ) {
90- if (rootNameCount == fsPath .getNameCount ()) {
90+ int nameCount = fsPath .getNameCount ();
91+
92+ if (rootNameCount == nameCount ) {
9193 strPath = "" ;
9294 } else {
93- strPath = fsPath .subpath (rootNameCount , fsPath .getNameCount ()).toString ();
94- if (strPath .endsWith (fsPath .getFileSystem ().getSeparator ())) {
95+ strPath = fsPath .subpath (rootNameCount , nameCount ).toString ().replace (fsPath .getFileSystem ().getSeparator (), "/" );
96+
97+ int strPathLength = strPath .length ();
98+
99+ if ((strPathLength > 0 ) && strPath .charAt (strPathLength -1 ) == '/' ) {
95100 // Cut last separator
96- strPath = strPath .substring (0 , strPath . length ()- fsPath . getFileSystem (). getSeparator (). length () );
101+ strPath = strPath .substring (0 , strPathLength - 1 );
97102 }
98103 }
99104 }
You can’t perform that action at this time.
0 commit comments