/**
* Upload the selected files and import them into the content package.
*/
private void uploadFiles() {
VFSContainer root = cp.getRootDir();
String filenName = file.getUploadFileName();
// don't check on mimetypes - some browser use different mime types when sending files (OLAT-4547)
if (filenName.toLowerCase().endsWith(".zip")) {
// unzip and add files
VFSLeaf archive = new LocalFileImpl(file.getUploadFile());
String archiveName = file.getUploadFileName();
String unzipDirName = archiveName.substring(0, archiveName.toLowerCase().indexOf(".zip"));
unzipDirName = VFSManager.similarButNonExistingName(root, unzipDirName);
VFSContainer unzipDir = root.createChildContainer(unzipDirName);
ZipUtil.unzip(archive, unzipDir);
// add items of unzipDir to tree
pageToBeSelected = addItem(unzipDir, currentPage.getIdentifier(), true);
CPManager.getInstance().writeToFile(cp);