Browse Source

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>
stable-4.1
Andrey Loskutov 9 years ago committed by Matthias Sohn
parent
commit
35d45abfb2
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
  2. 5
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
  3. 5
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
  4. 5
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java
  5. 5
      org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtil.java

4
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);
}
/**

5
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java

@ -260,11 +260,6 @@ public class FS_POSIX extends FS {
FileUtil.setLastModified(path, time);
}
@Override
public void delete(File path) throws IOException {
FileUtil.delete(path);
}
@Override
public long length(File f) throws IOException {
return FileUtil.getLength(f);

5
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java

@ -198,11 +198,6 @@ public class FS_Win32 extends FS {
FileUtil.setLastModified(path, time);
}
@Override
public void delete(File path) throws IOException {
FileUtil.delete(path);
}
@Override
public long length(File f) throws IOException {
return FileUtil.getLength(f);

5
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java

@ -183,11 +183,6 @@ public class FS_Win32_Cygwin extends FS_Win32 {
FileUtil.setLastModified(path, time);
}
@Override
public void delete(File path) throws IOException {
FileUtil.delete(path);
}
@Override
public long length(File f) throws IOException {
return FileUtil.getLength(f);

5
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) {

Loading…
Cancel
Save