lucastheisen / jsch-nio

Java nio FileSystem implementation over SSH
MIT License
99 stars 22 forks source link

change fileKey to BigDecimal to fix parseLong exceptions... #24

Closed richHoward closed 6 years ago

richHoward commented 6 years ago

...on large Inode values.

Inode values can quickly grow large on cloud servers, causing the fileKey attribute check to fail when cast as a Long. To avoid this, I have updated the fileKey attribute type to BigDecimal.

... .... ...

java.lang.NumberFormatException: For input string: "12108003092091700687" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:592) at java.lang.Long.parseLong(Long.java:631) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider$SupportedAttribute.toObject(UnixSshFileSystemProvider.java:911) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider.statParse(UnixSshFileSystemProvider.java:648) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider.readAttributes(UnixSshFileSystemProvider.java:541) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider.access$600(UnixSshFileSystemProvider.java:62) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider$BasicFileAttributesImpl.(UnixSshFileSystemProvider.java:762) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider$BasicFileAttributesImpl.(UnixSshFileSystemProvider.java:749) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider$BasicFileAttributesImpl.(UnixSshFileSystemProvider.java:741) at com.pastdev.jsch.nio.file.UnixSshFileSystemProvider.readAttributes(UnixSshFileSystemProvider.java:498) at java.nio.file.Files.readAttributes(Files.java:1737) at java.nio.file.Files.isRegularFile(Files.java:2229)

lucastheisen commented 6 years ago

Thanks for the patch. Released as 1.0.10