1 package org
.argeo
.cms
.cmd
;
3 import java
.util
.HashMap
;
6 import javax
.jcr
.Repository
;
7 import javax
.jcr
.RepositoryException
;
8 import javax
.jcr
.Session
;
10 import org
.apache
.commons
.logging
.Log
;
11 import org
.apache
.commons
.logging
.LogFactory
;
12 import org
.apache
.jackrabbit
.jcr2dav
.Jcr2davRepositoryFactory
;
13 import org
.argeo
.cms
.internal
.kernel
.KernelConstants
;
14 import org
.argeo
.jackrabbit
.fs
.DavexFsProvider
;
15 import org
.argeo
.jcr
.ArgeoJcrException
;
16 import org
.argeo
.jcr
.JcrUtils
;
17 import org
.argeo
.jcr
.fs
.JcrFileSystem
;
20 private final static Log log
= LogFactory
.getLog(Sync
.class);
22 public static void main(String args
[]) {
23 Map
<String
, String
> arguments
= new HashMap
<>();
24 boolean skipNext
= false;
25 String currValue
= null;
26 for (int i
= 0; i
< args
.length
; i
++) {
33 if (arg
.startsWith("-")) {
34 if (i
+ 1 < args
.length
) {
35 if (!args
[i
+ 1].startsWith("-")) {
36 currValue
= args
[i
+ 1];
40 arguments
.put(arg
, currValue
);
46 log
.debug("Hello world " + arguments
);
47 String sourceUri
= arguments
.get("-i");
48 DavexFsProvider fsProvider
= new DavexFsProvider();
49 // Map<String, String> params = new HashMap<String, String>();
50 // params.put(KernelConstants.JACKRABBIT_REPOSITORY_URI, sourceUri);
51 // params.put(KernelConstants.JACKRABBIT_REMOTE_DEFAULT_WORKSPACE, "main");
52 // Repository repository;
54 // repository = new Jcr2davRepositoryFactory().getRepository(params);
55 // if (repository == null)
56 // throw new ArgeoJcrException("Remote Davex repository " + sourceUri + " not found");
57 // Session session = repository.login();
58 // if (log.isDebugEnabled())
59 // log.debug("Opened JCR session to " + sourceUri);
60 // JcrUtils.logoutQuietly(session);
61 // } catch (RepositoryException e) {
62 // throw new ArgeoJcrException("Cannot load " + sourceUri, e);