FileUtil.moveFile now supports all permutations
This commit is contained in:
parent
a5cf709801
commit
4c77950f36
@ -424,19 +424,28 @@ class FileUtil {
|
|||||||
return one;
|
return one;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moves a file, overwriting any existing file at the destination.
|
||||||
|
*/
|
||||||
|
public static
|
||||||
|
File moveFile(String in, File out) throws IOException {
|
||||||
|
return moveFile(new File(in), out);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moves a file, overwriting any existing file at the destination.
|
||||||
|
*/
|
||||||
|
public static
|
||||||
|
File moveFile(File in, String out) throws IOException {
|
||||||
|
return moveFile(in, new File(out));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves a file, overwriting any existing file at the destination.
|
* Moves a file, overwriting any existing file at the destination.
|
||||||
*/
|
*/
|
||||||
public static
|
public static
|
||||||
File moveFile(String in, String out) throws IOException {
|
File moveFile(String in, String out) throws IOException {
|
||||||
if (in == null || in.isEmpty()) {
|
|
||||||
throw new IllegalArgumentException("in cannot be null.");
|
|
||||||
}
|
|
||||||
if (out == null || out.isEmpty()) {
|
|
||||||
throw new IllegalArgumentException("out cannot be null.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return moveFile(new File(in), new File(out));
|
return moveFile(new File(in), new File(out));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user