diff --git a/src/main/java/nl/esciencecenter/xenon/adaptors/filesystems/ftp/FtpFileSystem.java b/src/main/java/nl/esciencecenter/xenon/adaptors/filesystems/ftp/FtpFileSystem.java index d1b586115..6129b6865 100644 --- a/src/main/java/nl/esciencecenter/xenon/adaptors/filesystems/ftp/FtpFileSystem.java +++ b/src/main/java/nl/esciencecenter/xenon/adaptors/filesystems/ftp/FtpFileSystem.java @@ -312,13 +312,15 @@ protected void deleteFile(Path path) throws XenonException { public boolean exists(Path path) throws XenonException { try { - if (path.isEmpty()) { + Path tmp = toAbsolutePath(path); + + if (tmp.isEmpty()) { // special case for root. We assume it always exists. return true; } // otherwise, we try to get stats on the file or directory - getFTPFileInfo(toAbsolutePath(path)); + getFTPFileInfo(tmp); return true; } catch (NoSuchPathException e) { return false;