sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-ide-tooling] 03/05: SLING-5648 - Make Non-Eclipse Module regular Maven Packages
Date Thu, 05 Apr 2018 18:00:49 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/intellij
in repository https://gitbox.apache.org/repos/asf/sling-ide-tooling.git

commit 5f62a56870da1f7d68b8ccf40535fdb1d35bae19
Author: Robert Munteanu <rombert@apache.org>
AuthorDate: Thu Apr 5 19:43:18 2018 +0300

    SLING-5648 - Make Non-Eclipse Module regular Maven Packages
    
    Fix content import operation
---
 .../serialization/VltSerializationDataBuilder.java | 13 ++++++------
 .../vlt/serialization/VltSerializationManager.java | 24 ++++------------------
 2 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationDataBuilder.java
b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationDataBuilder.java
index fd33687..a5c1172 100644
--- a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationDataBuilder.java
+++ b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationDataBuilder.java
@@ -67,8 +67,13 @@ public class VltSerializationDataBuilder implements SerializationDataBuilder
{
 	private VaultFileSystem fs;
     private Logger logger;
 	
-	public VltSerializationDataBuilder(Logger logger) {
+	public VltSerializationDataBuilder(Logger logger, VaultFsLocator fsLocator) {
+	    if ( logger == null )
+	        throw new RuntimeException("Logger is null");
+        if ( fsLocator == null )
+            throw new RuntimeException("fsLocator is null");
 	    this.logger = logger;
+	    this.fsLocator = fsLocator;
 	}
 
     public void init(org.apache.sling.ide.transport.Repository repository, File contentSyncRoot)
@@ -341,10 +346,4 @@ public class VltSerializationDataBuilder implements SerializationDataBuilder
{
 
         return null;
     }
-
-    public void setLocator(VaultFsLocator locator) {
-
-        this.fsLocator = locator;
-    }
-
 }
diff --git a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
index a68475f..639203e 100644
--- a/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
+++ b/shared/modules/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
@@ -58,11 +58,12 @@ public class VltSerializationManager implements SerializationManager {
 
     static final String EXTENSION_XML = ".xml";
 
-    private VltSerializationDataBuilder builder;
-    
     @Reference
     private Logger logger;
 
+    @Reference
+    private VaultFsLocator fsLocator;
+
     public static void main(String[] args) throws RepositoryException, URISyntaxException,
IOException {
         RepositoryAddress address = new RepositoryAddress("http://localhost:8080/server/root");
         Repository repo = new RepositoryProvider().getRepository(address);
@@ -208,29 +209,12 @@ public class VltSerializationManager implements SerializationManager
{
     public String getOsPath(String repositoryPath) {
         return PlatformNameFormat.getPlatformPath(repositoryPath);
     }
-
-    protected void bindVaultFsLocator(VaultFsLocator fsLocator) {
-
-        getBuilder().setLocator(fsLocator);
-    }
-
-    protected void unbindVaultFsLocator(VaultFsLocator fsLocator) {
-
-        getBuilder().setLocator(null);
-    }
-    
-    private VltSerializationDataBuilder getBuilder() {
-    	if (builder==null) {
-    		builder = new VltSerializationDataBuilder(logger);
-    	}
-    	return builder;
-    }
     
     @Override
     public SerializationDataBuilder newBuilder(
     		org.apache.sling.ide.transport.Repository repository,
     		File contentSyncRoot) throws SerializationException {
-    	VltSerializationDataBuilder b = getBuilder();
+        VltSerializationDataBuilder b = new VltSerializationDataBuilder(logger, fsLocator);
     	b.init(repository, contentSyncRoot);
     	return b;
     }

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

Mime
View raw message