summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov <loskutov@gmx.de>2015-08-16 18:15:30 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2015-08-26 23:25:38 +0200
commit35d45abfb2d3b8c04b3cf4d0664dabb44e03fcd6 (patch)
treef7aabcf380937a97f42dc4d3ca574d1a46dfbb38
parent06b446057cb964a78b49497a2f5fb14f68e84577 (diff)
downloadjgit-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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtil.java5
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) {