GithubHelp home page GithubHelp logo

Comments (6)

OArtyomov avatar OArtyomov commented on July 26, 2024 1

It is very cool, that you added this method. But I think, it does not work correctly. Just small test from my side shows it. Test is failed with exception, that directory is already exist.

public class FakeTest {

    @ClassRule
    public static final FakeSftpServerRule sftpServer = new FakeSftpServerRule().setPort(8394);

    private static final JSch JSCH = new JSch();

    private static ChannelSftp connectSftpChannel(
            Session session
    ) throws JSchException {
        ChannelSftp channel = (ChannelSftp) session.openChannel("sftp");
        channel.connect();
        return channel;
    }

   @Test
    public void testDeleteSubdirectories() throws IOException, JSchException, SftpException {
       sftpServer.createDirectory("/firsLevel/secondLevel/thirdLevel");
       sftpServer.createDirectory("/firsLevel/secondLevel/thirdLevel1");
       sftpServer.createDirectory("/firsLevel/secondLevel/thirdLevel2");
       sftpServer.deleteAllFilesAndDirectories();
       sftpServer.createDirectory("/firsLevel/secondLevel/thirdLevel3");
       Session session = JSCH.getSession(
               "dummy user", "127.0.0.1", sftpServer.getPort());
       session.setConfig("StrictHostKeyChecking", "no");
       session.setPassword("dummy password");
       session.connect(20000);
       ChannelSftp channelSftp = connectSftpChannel(session);
       channelSftp.rename("/firsLevel/secondLevel/thirdLevel3", "/firsLevel/secondLevel/thirdLevel2");

   }
}

from fake-sftp-server-rule.

stefanbirkner avatar stefanbirkner commented on July 26, 2024 1

The bugfix release 1.3.1 is available on Maven Central.

from fake-sftp-server-rule.

OArtyomov avatar OArtyomov commented on July 26, 2024 1

Many thanks. Now it works as expected !!!!

from fake-sftp-server-rule.

stefanbirkner avatar stefanbirkner commented on July 26, 2024

Hi @OArtyomov,

thanks for the feature request. Can you explain your use case, please. I would like to understand why this method is needed.

from fake-sftp-server-rule.

stefanbirkner avatar stefanbirkner commented on July 26, 2024

Release 1.3.0 has a new method deleteAllFilesAndDirectories.

from fake-sftp-server-rule.

stefanbirkner avatar stefanbirkner commented on July 26, 2024

Thanks for testing the new release. I found the bug and fix it within the next few days.

from fake-sftp-server-rule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.