Niklas,
The method names where just illustrative, and I know some of them where
already provided - was just trying to think of a unified api that made
sense for file handling. I see your issue about AbsolutePath, didn't
know about NaitveFileSystemView and eventually I'd want an in memory
view anyway, so agreed I see the problems there. Maybe some URL like
openStream() method for a unversal way to read in the file? In my case I
just want a full proof way to read in the file and send it somewhere
else, and this would provide thatregardless of the underlying storage.
Mark
Niklas Gustavsson wrote:
Mark Proctor wrote:
The more I think about this now the more I think that FtpServer
should encapsulate this functionality, it's just one less thing for
the user to figure out and get wrong.
String getFileName() - returns just the file name, not the path
String getPath() - returns the path from the users home directory
String getAbsolulteFilePath() - returns the complete absolute file
path and name
File getFile() - returns a File object
I would have to say that I object to these. The reasons below:
String getFileName() - this would be the same value as
FtpRequest.getArgument(), right?
String getPath() - this should, and already is, part of the file
system interfaces, FileSystemView.getCurrentDirectory(). Wouldn't that
be sufficient?
String getAbsolulteFilePath() and File getFile() - this would make the
assumption that you really got a traditional file system backing the
FileSystemView. This is the case with NativeFileSystemView in which
case we provide this method, getPhysicalFile(). It's not the case when
you, for example, got a database backing a file system.
I did send an earlier reply to your questions but it seems to got
stuck somewhere, I'll resend it.
/niklas