Class ResourcesArchiverHelper.Importer
- java.lang.Object
-
- org.ametys.plugins.contentio.archive.ResourcesArchiverHelper.Importer
-
- Enclosing class:
- ResourcesArchiverHelper
private class ResourcesArchiverHelper.Importer extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ResourcesArchiverHelper.Importer.UnitaryCollectionImporter
private class
ResourcesArchiverHelper.Importer.UnitaryResourceImporter
-
Field Summary
Fields Modifier and Type Field Description private DocumentBuilder
_builder
private String
_commonPrefix
private List<JCRResource>
_importedResources
private org.slf4j.Logger
_logger
private Merger
_merger
private Node
_parentOfRoot
(package private) ImportReport
_report
private JCRResourcesCollection
_root
private ResourcesArchiverHelper.Importer.UnitaryCollectionImporter
_unitaryCollectionImporter
private ResourcesArchiverHelper.Importer.UnitaryResourceImporter
_unitaryResourceImporter
private Path
_zipArchivePath
-
Method Summary
-
-
-
Field Detail
-
_report
final ImportReport _report
-
_commonPrefix
private final String _commonPrefix
-
_parentOfRoot
private final Node _parentOfRoot
-
_zipArchivePath
private final Path _zipArchivePath
-
_logger
private final org.slf4j.Logger _logger
-
_builder
private final DocumentBuilder _builder
-
_importedResources
private final List<JCRResource> _importedResources
-
_root
private JCRResourcesCollection _root
-
_unitaryCollectionImporter
private final ResourcesArchiverHelper.Importer.UnitaryCollectionImporter _unitaryCollectionImporter
-
_unitaryResourceImporter
private final ResourcesArchiverHelper.Importer.UnitaryResourceImporter _unitaryResourceImporter
-
-
Constructor Detail
-
Importer
Importer(String commonPrefix, Node parentOfRoot, Path zipArchivePath, Merger merger, org.slf4j.Logger logger) throws ParserConfigurationException
- Throws:
ParserConfigurationException
-
-
Method Detail
-
importRoot
void importRoot() throws IOException
- Throws:
IOException
-
getImportedResource
List<JCRResource> getImportedResource()
-
_createResourceCollectionAcl
private void _createResourceCollectionAcl(Node collectionNode, String folderPath) throws IOException
- Throws:
IOException
-
_importChildren
private void _importChildren(Path folder) throws IOException
- Throws:
IOException
-
_getDirectFolderChildren
private DirectoryStream<Path> _getDirectFolderChildren(String pathPrefix) throws IOException
- Throws:
IOException
-
_getDirectFileChildren
private DirectoryStream<Path> _getDirectFileChildren(String pathPrefix) throws IOException
- Throws:
IOException
-
_importResourceCollectionAndChildren
private void _importResourceCollectionAndChildren(Path folder) throws IOException
- Throws:
IOException
-
_importResourceCollection
private Optional<Node> _importResourceCollection(Path folder) throws ImportGlobalFailException
- Throws:
ImportGlobalFailException
-
_getFolderPropertiesXml
private Document _getFolderPropertiesXml(Path folder) throws IOException
- Throws:
IOException
-
_createResourceCollection
private Node _createResourceCollection(Path folder, String id, Document propertiesXml) throws IOException, Archivers.AmetysObjectNotImportedException, TransformerException
-
_createChildResourceCollection
private Node _createChildResourceCollection(Node parentNode, String uuid, String collectionName) throws RepositoryException
- Throws:
RepositoryException
-
_relativePath
private String _relativePath(Path folderOrFile)
-
_retrieveParentJcrNode
private Node _retrieveParentJcrNode(Path fileOrFolder, boolean isRoot)
-
_importResource
private Optional<JCRResource> _importResource(Path file) throws ImportGlobalFailException
- Throws:
ImportGlobalFailException
-
_getFilePropertiesXml
private Document _getFilePropertiesXml(Path file) throws IOException
- Throws:
IOException
-
_createdResource
private JCRResource _createdResource(Path file, String id, Document propertiesXml) throws IOException, Archivers.AmetysObjectNotImportedException
-
_createChildResource
private Node _createChildResource(Node parentNode, String uuid, String resourceName) throws RepositoryException
- Throws:
RepositoryException
-
_resolveResource
private JCRResource _resolveResource(Node resourceNode)
-
_setResourceData
private void _setResourceData(Node resourceNode, Path file, Document propertiesXml) throws RepositoryException, IOException, TransformerException
-
_setResourceProperties
private void _setResourceProperties(Node resourceNode, Document propertiesXml) throws TransformerException, Archivers.AmetysObjectNotImportedException, RepositoryException
-
_setResourceMetadata
private void _setResourceMetadata(Node resourceNode, Path file) throws IOException
- Throws:
IOException
-
_setDublinCoreMetadata
private void _setDublinCoreMetadata(ModifiableDublinCoreAwareAmetysObject dcObject, Path file) throws IOException
- Throws:
IOException
-
_setDublinCoreMetadata
private void _setDublinCoreMetadata(ModifiableDublinCoreAwareAmetysObject dcObject, Document doc) throws TransformerException
- Throws:
TransformerException
-
_getMimeType
private String _getMimeType(Path file)
-
-