summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.java7
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-12-27 12:45:59 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2014-02-10 23:29:24 +0100
commit7c19c4554466537d0c9e845e9ce99507a500aa87 (patch)
tree928c23cefe3fc449fed487f937aada4752f87e12 /org.eclipse.jgit.java7
parent50a19fcdef271a74eb055f6996a425fc0c01d81f (diff)
downloadjgit-7c19c4554466537d0c9e845e9ce99507a500aa87.tar.gz
jgit-7c19c4554466537d0c9e845e9ce99507a500aa87.zip
Add delete support to FS
Change-Id: Ib6f6fd5ef4a0c9b2062445ac4a0c9d1131e401bf
Diffstat (limited to 'org.eclipse.jgit.java7')
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java5
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7.java5
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java5
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java5
4 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java
index b19a432e28..6a98481797 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java
@@ -107,6 +107,11 @@ public class FS_POSIX_Java7 extends FS_POSIX {
}
@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.java7/src/org/eclipse/jgit/util/FS_Win32_Java7.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7.java
index 98df7c85c1..5551632228 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7.java
@@ -108,6 +108,11 @@ public class FS_Win32_Java7 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.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java
index 1130668e5f..3db2e53e42 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java
@@ -84,6 +84,11 @@ public class FS_Win32_Java7Cygwin extends FS_Win32_Cygwin {
}
@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.java7/src/org/eclipse/jgit/util/FileUtil.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
index 3cf1c12ff1..428a45f79b 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
@@ -139,4 +139,9 @@ class FileUtil {
return path.setExecutable(executable);
}
+ public static void delete(File path) throws IOException {
+ Path nioPath = path.toPath();
+ Files.delete(nioPath);
+ }
+
}