Don't produce // as parentPath in EncFSLocalFileProvider
This commit is contained in:
parent
ff3a20305f
commit
dba45202f8
1 changed files with 7 additions and 1 deletions
|
@ -336,11 +336,17 @@ public class EncFSLocalFileProvider implements EncFSFileProvider {
|
|||
if (file.equals(rootPath.getAbsoluteFile())) {
|
||||
// we're dealing with the root dir
|
||||
relativePath = "/";
|
||||
} else if (file.getParentFile().equals(rootPath.getAbsoluteFile())) {
|
||||
// File is child of the root path
|
||||
relativePath = "/";
|
||||
} else {
|
||||
relativePath = file.getParentFile().getAbsolutePath()
|
||||
.substring(rootPath.getAbsoluteFile().toString().length());
|
||||
relativePath = "/" + relativePath.replace("\\", "/");
|
||||
if (!relativePath.equals("/")) {
|
||||
relativePath = "/" + relativePath.replace("\\", "/");
|
||||
}
|
||||
}
|
||||
|
||||
String name = file.getName();
|
||||
EncFSFileInfo result = new EncFSFileInfo(name, relativePath,
|
||||
file.isDirectory(), file.lastModified(), file.length(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue