From 9bb126d12d812bb791d8c2f8bf48b5edb25d34ad Mon Sep 17 00:00:00 2001 From: Marc Strapetz Date: Tue, 14 Nov 2017 10:02:07 +0100 Subject: 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 --- .../org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit.test/exttst') 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, -- cgit v1.2.3