public boolean changeWorkingDirectory()

in pekko-connectors-sample-rotate-logs-to-ftp/src/main/java/playground/filesystem/impl/JimfsView.java [115:132]


    public boolean changeWorkingDirectory(String dir) throws FtpException {

        // not a directory - return false
        dir = getPhysicalName(dir);
        Path dirPath = fileSystem.getPath(dir);
        if (!Files.isDirectory(dirPath)) {
            return false;
        }

        // strip user root and add last '/' if necessary
        dir = dir.substring(rootDir.length() - 1);
        if (dir.charAt(dir.length() - 1) != '/') {
            dir = dir + '/';
        }

        currDir = dir;
        return true;
    }