Package org.opencms.db
Class CmsImportFolder
java.lang.Object
org.opencms.db.CmsImportFolder
Allows to import resources from the filesystem or a ZIP file into the OpenCms VFS.
- Since:
- 6.0.0
-
Constructor Summary
ConstructorDescriptionDefault Constructor.CmsImportFolder
(byte[] content, String importPath, CmsObject cms, boolean noSubFolder) Constructor for a new CmsImportFolder that will read from a ZIP file.CmsImportFolder
(String importFolderName, String importPath, CmsObject cms) Constructor for a new CmsImportFolder that will read from the real file system. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of imported resources.void
importFolder
(String importFolderName, String importPath, CmsObject cms) Import that will read from the real file system.void
Import that will read from a ZIP file.boolean
Returns true if a valid ZIP file was imported.
-
Constructor Details
-
CmsImportFolder
public CmsImportFolder()Default Constructor. -
CmsImportFolder
public CmsImportFolder(byte[] content, String importPath, CmsObject cms, boolean noSubFolder) throws CmsException Constructor for a new CmsImportFolder that will read from a ZIP file.- Parameters:
content
- the zip file to importimportPath
- the path to the OpenCms VFS to import tocms
- a OpenCms context to provide the permissionsnoSubFolder
- iftrue
no sub folders will be created, iffalse
the content of the zip file is created 1:1 inclusive sub folders- Throws:
CmsException
- if something goes wrong
-
CmsImportFolder
public CmsImportFolder(String importFolderName, String importPath, CmsObject cms) throws CmsException Constructor for a new CmsImportFolder that will read from the real file system.- Parameters:
importFolderName
- the folder to importimportPath
- the path to the OpenCms VFS to import tocms
- a OpenCms context to provide the permissions- Throws:
CmsException
- if something goes wrong
-
-
Method Details
-
getImportedResources
Returns the list of imported resources.- Returns:
- the list of imported resources
-
importFolder
public void importFolder(String importFolderName, String importPath, CmsObject cms) throws CmsException Import that will read from the real file system.- Parameters:
importFolderName
- the folder to importimportPath
- the path to the OpenCms VFS to import tocms
- a OpenCms context to provide the permissions- Throws:
CmsException
- if something goes wrong
-
importZip
public void importZip(byte[] content, String importPath, CmsObject cms, boolean noSubFolder) throws CmsException Import that will read from a ZIP file.- Parameters:
content
- the zip file to importimportPath
- the path to the OpenCms VFS to import tocms
- a OpenCms context to provide the permissionsnoSubFolder
- iftrue
no sub folders will be created, iffalse
the content of the zip file is created 1:1 inclusive sub folders- Throws:
CmsException
- if something goes wrong
-
isValidZipFile
Returns true if a valid ZIP file was imported.- Returns:
- true if a valid ZIP file was imported
-