开发者

Should NLST FTP command return records with or without absolute paths?

开发者 https://www.devze.com 2023-02-14 06:16 出处:网络
in my J开发者_如何学编程ava project I am using Apache FTP Client to download some data from FTP server.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消