diff options
author | Marc Strapetz <marc.strapetz@syntevo.com> | 2017-11-14 10:02:07 +0100 |
---|---|---|
committer | Marc Strapetz <marc.strapetz@syntevo.com> | 2017-11-14 10:07:37 +0100 |
commit | 9bb126d12d812bb791d8c2f8bf48b5edb25d34ad (patch) | |
tree | 39610bf5dc832d37cb2ab18ad8afd158a103decf /org.eclipse.jgit.test/exttst/org/eclipse/jgit | |
parent | 4bdf0ec67978a0ac28fe40fd104736502f48fded (diff) | |
download | jgit-9bb126d12d812bb791d8c2f8bf48b5edb25d34ad.tar.gz jgit-9bb126d12d812bb791d8c2f8bf48b5edb25d34ad.zip |
FileUtils.toPath to convert File to Path
When invoking File.toPath(), an (unchecked) InvalidPathException may be
thrown which should be converted to a checked IOException.
For now, we will replace File.toPath() by FileUtils.toPath() only for
code which can already handle IOExceptions.
Change-Id: I0f0c5fd2a11739e7a02071adae9a5550985d4df6
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Diffstat (limited to 'org.eclipse.jgit.test/exttst/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java index db5f1b2eb6..e5a80aeefa 100644 --- a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java +++ b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java @@ -56,6 +56,7 @@ import java.util.List; import java.util.Random; import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.util.FileUtils; import org.junit.Assert; import org.junit.Test; @@ -156,7 +157,7 @@ public class CGitVsJGitRandomIgnorePatternTest { throws UnsupportedEncodingException, IOException { this.gitDir = gitDir; this.pattern = pattern; - Files.write(new File(gitDir, ".gitignore").toPath(), + Files.write(FileUtils.toPath(new File(gitDir, ".gitignore")), (pattern + "\n").getBytes("UTF-8"), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, |