git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Serialisation utilities update
[fanfix.git]
/
src
/
be
/
nikiroo
/
utils
/
IOUtils.java
diff --git
a/src/be/nikiroo/utils/IOUtils.java
b/src/be/nikiroo/utils/IOUtils.java
index eb105e2698535e325ed602fc0b3ed50f7e0b16b4..b0566432aeb7fad7aae1938e7162a9810ed8ae2a 100644
(file)
--- a/
src/be/nikiroo/utils/IOUtils.java
+++ b/
src/be/nikiroo/utils/IOUtils.java
@@
-49,7
+49,7
@@
public class IOUtils {
*
* @param in
* the data source
*
* @param in
* the data source
- * @param
targe
t
+ * @param
ou
t
* the target {@link OutputStream}
*
* @throws IOException
* the target {@link OutputStream}
*
* @throws IOException
@@
-118,7
+118,7
@@
public class IOUtils {
* the source {@link File} (which can be a directory)
* @param dest
* the destination <tt>.zip</tt> file
* the source {@link File} (which can be a directory)
* @param dest
* the destination <tt>.zip</tt> file
- * @param src
t
IsRoot
+ * @param srcIsRoot
* FALSE if we need to add a {@link ZipEntry} for src, TRUE to
* add it at the root of the ZIP
*
* FALSE if we need to add a {@link ZipEntry} for src, TRUE to
* add it at the root of the ZIP
*
@@
-202,20
+202,15
@@
public class IOUtils {
* the target to delete
*/
public static void deltree(File target) {
* the target to delete
*/
public static void deltree(File target) {
- for (File file : target.listFiles()) {
- if (file.isDirectory()) {
+ File[] files = target.listFiles();
+ if (files != null) {
+ for (File file : files) {
deltree(file);
deltree(file);
- } else {
- if (!file.delete()) {
- System.err.println("Cannot delete file: "
- + file.getAbsolutePath());
- }
}
}
if (!target.delete()) {
}
}
if (!target.delete()) {
- System.err.println("Cannot delete file: "
- + target.getAbsolutePath());
+ System.err.println("Cannot delete: " + target.getAbsolutePath());
}
}
}
}