FTP directory path with spaces

1

Good morning, I'm having trouble getting to a subdirectory on ftp, the name of one of the subdirectories has space, so I can not move forward. I'm doing a project in Java. Could someone please help?

ftp.changeWorkingDirectory("/Premium%202.0/Executaveis/Producao");

In this case, when I copy the path, it inserts% 2, so only the root of ftp is listed.

    
asked by anonymous 03.01.2018 / 13:19

1 answer

0

You can try to use the \ backslash to escape the space, just as you do when browsing linux directories. Here's how:

ftp.changeWorkingDirectory("/Premium\ 2.0/Executaveis/Producao");

You need to use two backslashes because java uses the backslash as an escape character.

    
03.01.2018 / 13:33