]> source.dussan.org Git - jgit.git/commit
Don't use java.nio channel for file size determination 76/5276/11
authorMarkus Duft <markus.duft@salomon.at>
Mon, 2 Apr 2012 05:27:19 +0000 (07:27 +0200)
committerMarkus Duft <markus.duft@salomon.at>
Mon, 2 Apr 2012 05:27:25 +0000 (07:27 +0200)
commit2ba67bedaebc1df9e891d701aa46bde753924a64
tree7d40944d8dffd23697533a8d64cf9d8dc2dd279c
parent6189a68d1d48e38779380cea81efa530405ff762
Don't use java.nio channel for file size determination

Java NIO has some problems (like files closing unexpectedly because the
thread was interrupted). To avoid those problems, don't use a NIO
channel to determine the size of a file, but rather ask the File itself.

We have to be prepared to handle wrong/outdated information in this case
too, as the inode of the File may change between opening and determining
file size.

Change-Id: Ic7aa6c3337480879efcce4a3058b548cd0e2cef0
org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java