projects
/
jSite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add warning if a project is larger than 2 MiBs.
[jSite.git]
/
src
/
de
/
todesbaum
/
jsite
/
application
/
ProjectInserter.java
diff --git
a/src/de/todesbaum/jsite/application/ProjectInserter.java
b/src/de/todesbaum/jsite/application/ProjectInserter.java
index
3a49c49
..
eb5abda
100644
(file)
--- a/
src/de/todesbaum/jsite/application/ProjectInserter.java
+++ b/
src/de/todesbaum/jsite/application/ProjectInserter.java
@@
-392,6
+392,7
@@
public class ProjectInserter implements FileScannerListener, Runnable {
checkReport.addIssue("error.no-files-to-insert", true);
}
Set<String> fileNames = new HashSet<String>();
checkReport.addIssue("error.no-files-to-insert", true);
}
Set<String> fileNames = new HashSet<String>();
+ long totalSize = 0;
for (Entry<String, FileOption> fileOptionEntry : fileOptionEntries) {
FileOption fileOption = fileOptionEntry.getValue();
if (!fileOption.isInsert() && !fileOption.isInsertRedirect()) {
for (Entry<String, FileOption> fileOptionEntry : fileOptionEntries) {
FileOption fileOption = fileOptionEntry.getValue();
if (!fileOption.isInsert() && !fileOption.isInsertRedirect()) {
@@
-406,6
+407,12
@@
public class ProjectInserter implements FileScannerListener, Runnable {
if (!fileNames.add(fileName)) {
checkReport.addIssue("error.duplicate-file", true, fileName);
}
if (!fileNames.add(fileName)) {
checkReport.addIssue("error.duplicate-file", true, fileName);
}
+ if (fileOption.isInsert()) {
+ totalSize += new File(project.getLocalPath(), fileName).length();
+ }
+ }
+ if (totalSize > 2 * 1024 * 1024) {
+ checkReport.addIssue("warning.site-larger-than-2-mib", false);
}
return checkReport;
}
}
return checkReport;
}