wanena / ganymed-ssh-2

Automatically exported from code.google.com/p/ganymed-ssh-2
Other
0 stars 0 forks source link

Classes should implement java.lang.AutoClosable (available since 1.7) where applicable #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is an enhancement request and not an issue per se.
The goal is to make resource management easier.

Writing e.g. the following should be possible:
try (SFTPv3Client client = new SFTPv3Client(new Connection("localhost"))) {
}
AutoClosable should also be implemented by classes such as SFTPv3FileHandle.

http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html
http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html

Original issue reported on code.google.com by refsdal....@gmail.com on 12 Apr 2014 at 4:02

GoogleCodeExporter commented 9 years ago
Yes please implement AutoClosable. That would be very good.

Original comment by jart@google.com on 18 Apr 2014 at 7:46