/** * Constructor for a new CmsImportFolder that will read from the real file system.<p> * * @param importFolderName the folder to import * @param importPath the path to the OpenCms VFS to import to * @param cms a OpenCms context to provide the permissions * @throws CmsException if something goes wrong */ public CmsImportFolder(String importFolderName, String importPath, CmsObject cms) throws CmsException { importFolder(importFolderName, importPath, cms); }
/** * Constructor for a new CmsImportFolder that will read from a ZIP file.<p> * * @param content the zip file to import * @param importPath the path to the OpenCms VFS to import to * @param cms a OpenCms context to provide the permissions * @param noSubFolder if <code>true</code> no sub folders will be created, if <code>false</code> the content of the * zip file is created 1:1 inclusive sub folders * * @throws CmsException if something goes wrong */ public CmsImportFolder(byte[] content, String importPath, CmsObject cms, boolean noSubFolder) throws CmsException { importZip(content, importPath, cms, noSubFolder); }
m_cms = cms; getImportResource(); importResources(m_importResource, m_importPath); } else { importZipResource(m_zipStreamIn, m_importPath, false);
CmsImportFolder importZip = new CmsImportFolder(); try { importZip.importZip(content, targetFolder, cms, false); } finally { for (CmsResource importedResource : importZip.getImportedResources()) { m_resourcesCreated.put( importedResource.getStructureId().toString(),
CmsImportFolder importFolder = new CmsImportFolder(content, currentFolder, getCms(), false); for (CmsResource importedResource : importFolder.getImportedResources()) { m_uploadedFiles.add(importedResource.getStructureId().toString());
new CmsImportFolder(content, currentFolder, getCms(), false);
/** * Import that will read from a ZIP file.<p> * * @param content the zip file to import * @param importPath the path to the OpenCms VFS to import to * @param cms a OpenCms context to provide the permissions * @param noSubFolder if <code>true</code> no sub folders will be created, if <code>false</code> the content of the * zip file is created 1:1 inclusive sub folders * * @throws CmsException if something goes wrong */ public void importZip(byte[] content, String importPath, CmsObject cms, boolean noSubFolder) throws CmsException { m_importPath = importPath; m_cms = cms; try { // open the import resource m_zipStreamIn = new ZipInputStream(new ByteArrayInputStream(content)); m_cms.readFolder(importPath, CmsResourceFilter.IGNORE_EXPIRATION); // import the resources importZipResource(m_zipStreamIn, m_importPath, noSubFolder); } catch (Exception e) { throw new CmsVfsException(Messages.get().container(Messages.ERR_IMPORT_FOLDER_1, importPath), e); } }
importResources(currentFile, importPath + currentFile.getName() + "/"); } else {
m_cms = cms; getImportResource(); importResources(m_importResource, m_importPath); } else { importZipResource(m_zipStreamIn, m_importPath, false);
/** * Constructor for a new CmsImportFolder that will read from a ZIP file.<p> * * @param content the zip file to import * @param importPath the path to the OpenCms VFS to import to * @param cms a OpenCms context to provide the permissions * @param noSubFolder if false no sub folder will be created * @throws CmsException if something goes wrong */ public CmsImportFolder(byte[] content, String importPath, CmsObject cms, boolean noSubFolder) throws CmsException { m_importPath = importPath; m_cms = cms; try { // open the import resource m_zipStreamIn = new ZipInputStream(new ByteArrayInputStream(content)); m_cms.readFolder(importPath, CmsResourceFilter.IGNORE_EXPIRATION); // import the resources importZipResource(m_zipStreamIn, m_importPath, noSubFolder); } catch (Exception e) { throw new CmsVfsException(Messages.get().container(Messages.ERR_IMPORT_FOLDER_1, importPath), e); } }
importResources(currentFile, importPath + currentFile.getName() + "/"); } else {