diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-13 07:37:36 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-13 07:38:38 +0100 |
commit | b0d27cdae9028585a861f16d5943f3084af6299d (patch) | |
tree | 569cb25d98b0ed45d459aeef71ac7433c4203eaf /org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java | |
parent | 57f3ee4c160c68dd603165d000de617182c6ae85 (diff) | |
parent | 7480737aac78a2c6e1acca37715bf61a5fa494bb (diff) | |
download | jgit-b0d27cdae9028585a861f16d5943f3084af6299d.tar.gz jgit-b0d27cdae9028585a861f16d5943f3084af6299d.zip |
Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
Prepare 4.11.8-SNAPSHOT builds
JGit v4.11.7.201903122105-r
Prepare 4.9.10-SNAPSHOT builds
JGit v4.9.9.201903122025-r
Prepare 4.7.9-SNAPSHOT builds
JGit v4.7.8.201903121755-r
Prepare 4.5.7-SNAPSHOT builds
JGit v4.5.6.201903121547-r
Check for packfile validity and fd before reading
Move throw of PackInvalidException outside the catch
Use FileSnapshot to get lastModified on PackFile
Include size when comparing FileSnapshot
Do not reuse packfiles when changed on filesystem
Silence API warnings for new API introduced for fixes
Change-Id: I71771dcc086a9a0097bad74d65ec71ad97106a38
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java index ecfd31647d..97f480dd36 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java @@ -660,6 +660,19 @@ public class FileUtils { } /** + * Return all the attributes of a file, without following symbolic links. + * + * @param file + * @return {@link BasicFileAttributes} of the file + * @throws IOException in case of any I/O errors accessing the file + * + * @since 4.5.6 + */ + static BasicFileAttributes fileAttributes(File file) throws IOException { + return Files.readAttributes(file.toPath(), BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); + } + + /** * @param file * @param time * @throws IOException |