I am uploading a file via FTP to a Linux server. I use Apache's [`FTPClient`](http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html).

So let's say I wanted to upload the file `C:\\downloads\\13\\myFile.txt` to the server at `/data/downloads/13/myFile.txt`

Before I upload, I determine whether the directory that it will be sent to exists using `listFiles`.

When I say

```
ftp.listFiles("/data/downloads/13");

```

I get an array containing one file object, meaning that the path exists (and I don't need to create a folder). However when I say

```
ftp.listFiles("\\data\\downloads\\13");

```

I get an empty array, meaning the path does not exist.

The reason for this is because I'm running my application from a Windows machine, so the path separator is different.

The solution I've decided on is to normalize the paths by replacing `\` with `/` before I proceed with the FTP transactions.

Is this the proper way to address this issue?