Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
2.2
Description
The FTP server is FileZilla.
1. Get a stream instance from an FtpFileObject via the `getInputStream` method.
2. Read some bytes from the stream.
3. Close the stream via `stream.close()`.
4. If the stream has not been completely read, the FTP server sends a `426 Connection closed; transfer aborted` response code.
5. `FtpFileObject::onClose` is called.
6. Eventually `FTPReply::isPositiveCompletion` is called.
7. Since the response code is outside the [200; 300) range it is considered an error.
8. A `FileSystemException` is thrown.
The overall result is that when closing a stream that is not completely read an exception is thrown. Which is obviously wrong.
A similar things happens with this piece of code:
try (FileContent content = ftpFileObject.getContent()) { // ...... }
Is there an easy way we can patch this in VFS as this is a showstopper for us?