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>
This commit is contained in:
parent
06b446057c
commit
35d45abfb2
|
@ -285,9 +285,7 @@ public long length(File path) throws IOException {
|
||||||
* @since 3.3
|
* @since 3.3
|
||||||
*/
|
*/
|
||||||
public void delete(File f) throws IOException {
|
public void delete(File f) throws IOException {
|
||||||
if (!f.delete())
|
FileUtils.delete(f);
|
||||||
throw new IOException(MessageFormat.format(
|
|
||||||
JGitText.get().deleteFileFailed, f.getAbsolutePath()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -260,11 +260,6 @@ public void setLastModified(File path, long time) throws IOException {
|
||||||
FileUtil.setLastModified(path, time);
|
FileUtil.setLastModified(path, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void delete(File path) throws IOException {
|
|
||||||
FileUtil.delete(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long length(File f) throws IOException {
|
public long length(File f) throws IOException {
|
||||||
return FileUtil.getLength(f);
|
return FileUtil.getLength(f);
|
||||||
|
|
|
@ -198,11 +198,6 @@ public void setLastModified(File path, long time) throws IOException {
|
||||||
FileUtil.setLastModified(path, time);
|
FileUtil.setLastModified(path, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void delete(File path) throws IOException {
|
|
||||||
FileUtil.delete(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long length(File f) throws IOException {
|
public long length(File f) throws IOException {
|
||||||
return FileUtil.getLength(f);
|
return FileUtil.getLength(f);
|
||||||
|
|
|
@ -183,11 +183,6 @@ public void setLastModified(File path, long time) throws IOException {
|
||||||
FileUtil.setLastModified(path, time);
|
FileUtil.setLastModified(path, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void delete(File path) throws IOException {
|
|
||||||
FileUtil.delete(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long length(File f) throws IOException {
|
public long length(File f) throws IOException {
|
||||||
return FileUtil.getLength(f);
|
return FileUtil.getLength(f);
|
||||||
|
|
|
@ -193,10 +193,11 @@ public static boolean canExecute(File path) {
|
||||||
/**
|
/**
|
||||||
* @param path
|
* @param path
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
* @deprecated use {@link FileUtils#delete(File)}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static void delete(File path) throws IOException {
|
public static void delete(File path) throws IOException {
|
||||||
Path nioPath = path.toPath();
|
FileUtils.delete(path);
|
||||||
Files.delete(nioPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Attributes getFileAttributesBasic(FS fs, File path) {
|
static Attributes getFileAttributesBasic(FS fs, File path) {
|
||||||
|
|
Loading…
Reference in New Issue