in my J开发者_如何学编程ava project I am using Apache FTP Client to download some data from FTP server.
On production there is running some FTP server on Linux which returns files with abosulte paths when using NLST. So my response for NLST /home
might be e.g. /home/user
.
For testing I am using Mock FTP Server and surprisingly this mock FTP server returns relative paths when using NLST. So for the example above is will return only user
.
I was wondering (and didn't find out even not in RFC 959) if there is some standard if the NLST
should return absolute or relative paths. Maybe there is some switch for this purpose? Sofar I stick with checking the returned names if they are or are not relative and if they are I make them absolute myself. But maybe there is better solution out there?
Just to note I am using FakeUnixFileSystem
for testing so OS type should not be involved in this issue.
NLST is supposed to return a list of relative file names with no other information about them whatsoever, so I'd say Mock FTP Server is doing the right thing.
精彩评论