X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProjectInserter.java;h=eb5abdabba965ab138574300e9bbd977e87e8960;hb=51ef8ebc341e6ec53237bbeb18860ff77e591ac4;hp=3a49c49a3549d5d4abccec6f612ea1ae3c454163;hpb=96899c6cf5eff34ad34666212c36bcefaa1a590f;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index 3a49c49..eb5abda 100644 --- 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 fileNames = new HashSet(); + long totalSize = 0; for (Entry 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 (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; }