0

I was wondering why filezilla was sending me backward slashes when I am implementing a FTP server.I believe that it may interfere with another function I have to download files. (RETR). This is my CWD code:

private void Cwd( String param ){
    System.out.println(param);

    System.out.println("CWD OLD " + this.fileManager.getPath());
    String old = this.fileManager.getPath();
    if( !param.startsWith("/") ){
        param = old + File.separator + param;

    }
    this.fileManager = new File( param );
    System.out.println("NEW ONE CWD " + this.fileManager.getPath());
    if( !this.fileManager.isDirectory() )
        this.fileManager = new File( old );

    sendOut( "200 cwd OK" );

}

enter image description here

Dan
  • 45
  • 9
  • What it sends you depends on what its platform is. There is no error here. You don't have any reason to expect `/`. You also don't have any reason to use your own local `File.separator` in the directory name. – user207421 Nov 05 '15 at 00:33
  • Where does it send you backward slashes? There are forward slashes in the `CWD` command. Show us FileZilla log file (a real log file, not message log from GUI). – Martin Prikryl Nov 05 '15 at 07:17

0 Answers0