diff --git a/olat3/webapp/WEB-INF/src/org/olat/course/nodes/TACourseNode.java b/olat3/webapp/WEB-INF/src/org/olat/course/nodes/TACourseNode.java index 52ac8fe6e8c4d9e99d320c18212f5f878e255ad3..6ec68215fe701d0114f133f43f9da784198163a4 100644 --- a/olat3/webapp/WEB-INF/src/org/olat/course/nodes/TACourseNode.java +++ b/olat3/webapp/WEB-INF/src/org/olat/course/nodes/TACourseNode.java @@ -840,10 +840,21 @@ public class TACourseNode extends GenericCourseNode implements AssessableCourseN } // copy dropboxes to tmp dir if (dropboxDir.exists()) { - FileUtils.copyDirContentsToDir(dropboxDir, new File(tmpDirPath + "/dropboxes"),false, "archive task course node dropboxes" ); - fileList.add("dropboxes"); - //dropboxes exists, so there is something to archive - dataFound = true; + //OLAT-6362 archive only dropboxes of users that handed in at least one file -> prevent empty folders in archive + File[] dropBoxContent = dropboxDir.listFiles(); + boolean validDropboxesfound = false; + for (File file : dropBoxContent) { + if(file.isDirectory() && !FileUtils.isDirectoryEmpty(file)){ + validDropboxesfound = true; + FileUtils.copyDirContentsToDir(file, new File(tmpDirPath + "/dropboxes/"+file.getName()), false, "archive task course node dropboxes "+file.getName()); + } + } + + if(validDropboxesfound){ + // dropboxes exists and at least one is not empty, so there is something to archive + dataFound = true; + fileList.add("dropboxes"); + } } // copy only the choosen task to user taskfolder, loop over all users String taskfolderPath = FolderConfig.getCanonicalRoot() + TACourseNode.getTaskFolderPathRelToFolderRoot(course.getCourseEnvironment(),this);