diff options
author | Andrey Loskutov <loskutov@gmx.de> | 2015-08-16 18:15:30 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2015-08-26 23:25:38 +0200 |
commit | 35d45abfb2d3b8c04b3cf4d0664dabb44e03fcd6 (patch) | |
tree | f7aabcf380937a97f42dc4d3ca574d1a46dfbb38 | |
parent | 06b446057cb964a78b49497a2f5fb14f68e84577 (diff) | |
download | jgit-35d45abfb2d3b8c04b3cf4d0664dabb44e03fcd6.tar.gz jgit-35d45abfb2d3b8c04b3cf4d0664dabb44e03fcd6.zip |
Deprecate redundant FileUtil.delete(File), use FileUtils instead
Bug: 475070
Change-Id: I6dc651f4b47e1b2c8d7954ec982e21ae6bb5f7a6
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 files changed, 4 insertions, 20 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index 6ce348c1be..4d34394ba0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -285,9 +285,7 @@ public abstract class FS { * @since 3.3 */ public void delete(File f) throws IOException { - if (!f.delete()) - throw new IOException(MessageFormat.format( - JGitText.get().deleteFileFailed, f.getAbsolutePath())); + FileUtils.delete(f); } /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java index 22c1abd7d9..2cd82df34f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java @@ -261,11 +261,6 @@ public class FS_POSIX extends FS { } @Override - public void delete(File path) throws IOException { - FileUtil.delete(path); - } - - @Override public long length(File f) throws IOException { return FileUtil.getLength(f); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java index 8ff274e109..987046cbff 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java @@ -199,11 +199,6 @@ public class FS_Win32 extends FS { } @Override - public void delete(File path) throws IOException { - FileUtil.delete(path); - } - - @Override public long length(File f) throws IOException { return FileUtil.getLength(f); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java index 6c5e73d051..7933dcd314 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java @@ -184,11 +184,6 @@ public class FS_Win32_Cygwin extends FS_Win32 { } @Override - public void delete(File path) throws IOException { - FileUtil.delete(path); - } - - @Override public long length(File f) throws IOException { return FileUtil.getLength(f); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtil.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtil.java index 5dfba4ac4a..fd53a95b5a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtil.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtil.java @@ -193,10 +193,11 @@ public class FileUtil { /** * @param path * @throws IOException + * @deprecated use {@link FileUtils#delete(File)} */ + @Deprecated public static void delete(File path) throws IOException { - Path nioPath = path.toPath(); - Files.delete(nioPath); + FileUtils.delete(path); } static Attributes getFileAttributesBasic(FS fs, File path) { |