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
Text justification: tests (WIP) + code (WIP)
[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 bf0686babca9e7addfbbd810a7a8e4d5fd66756d..d83311449c3bb5016ae35b396284f56822786ee0 100644
(file)
--- a/
src/be/nikiroo/utils/IOUtils.java
+++ b/
src/be/nikiroo/utils/IOUtils.java
@@
-89,8
+89,12
@@
public class IOUtils {
}
zip.putNextEntry(new ZipEntry(base + "/"));
}
}
zip.putNextEntry(new ZipEntry(base + "/"));
}
- for (File file : target.listFiles()) {
- zip(zip, base, file, false);
+
+ File[] files = target.listFiles();
+ if (files != null) {
+ for (File file : files) {
+ zip(zip, base, file, false);
+ }
}
} else {
if (base == null || base.isEmpty()) {
}
} else {
if (base == null || base.isEmpty()) {
@@
-234,13
+238,13
@@
public class IOUtils {
throws IOException {
List<File> list = deltree(target, null);
if (exception && !list.isEmpty()) {
throws IOException {
List<File> list = deltree(target, null);
if (exception && !list.isEmpty()) {
- String
slist = ""
;
+ String
Builder slist = new StringBuilder()
;
for (File file : list) {
for (File file : list) {
- slist
+= "\n" + file.getPath(
);
+ slist
.append("\n").append(file.getPath()
);
}
throw new IOException("Cannot delete all the files from: <" //
}
throw new IOException("Cannot delete all the files from: <" //
- + target + ">:" + slist);
+ + target + ">:" + slist
.toString()
);
}
return list.isEmpty();
}
return list.isEmpty();