Package org.apache.jackrabbit.vault.fs.api

Examples of org.apache.jackrabbit.vault.fs.api.RepositoryAddress


            StringBuffer uri = new StringBuffer(getProperty(KEY_DEFAULT_URI));
            uri.append("/").append(session.getWorkspace().getName());
            if (root != null && !"/".equals(root)) {
                uri.append(root);
            }
            RepositoryAddress mp =
                    new RepositoryAddress(uri.toString());
            log.info("Mounting JcrFs on {}", mp.toString());

            ExportRoot exportRoot = ExportRoot.findRoot(getPlatformFile("", true));
            MetaInf inf = exportRoot == null ? null : exportRoot.getMetaInf();

            // get config
View Full Code Here


        if (rep != null) {
            throw new ExecutionException("Already connected to " + getProperty(KEY_URI));
        } else {
            String uri = getProperty(KEY_DEFAULT_URI);
            try {
                rep = repProvider.getRepository(new RepositoryAddress(uri));
                setProperty(KEY_URI, uri);
                StringBuffer info = new StringBuffer();
                info.append(rep.getDescriptor(Repository.REP_NAME_DESC)).append(' ');
                info.append(rep.getDescriptor(Repository.REP_VERSION_DESC));
                log.info("Connected to {} ({})", uri, info.toString());
View Full Code Here

            cwd = new File(".").getCanonicalFile();
        } catch (IOException e) {
            throw new ExecutionException(e);
        }
        ExportRoot exportRoot = ExportRoot.findRoot(cwd);
        RepositoryAddress mountpoint = null;
        if (exportRoot != null) {
            try {
                File dir = new File(exportRoot.getJcrRoot(), VltDirectory.META_DIR_NAME);
                MetaDirectory rootMeta = VltContext.createMetaDirectory(dir);
                String addr = rootMeta.getRepositoryUrl();
                if (addr != null) {
                    mountpoint = new RepositoryAddress(addr);
                }
            } catch (Exception e) {
                // ignore
            }
        }
        if (mountpoint == null) {
            setProperty(KEY_DEFAULT_URI, DEFAULT_URI);
        } else {
            setProperty(KEY_DEFAULT_URI, mountpoint.getSpecificURI().toString());
            setProperty(KEY_DEFAULT_WORKSPACE, mountpoint.getWorkspace());
            setProperty(KEY_DEFAULT_MOUNTPOINT, mountpoint.getPath());
        }
        setProperty(KEY_PROMPT, "$ ");

        // add platform context
        console = new VaultFsConsole(this);
View Full Code Here

        Sync.Command cmd = (Sync.Command) cl.getValue(argCommand);
        if (cmd == null) {
            cmd = Sync.Command.INIT;
        }
        String root = (String) cl.getValue(optUri);
        RepositoryAddress addr = root == null
                ? null
                : new RepositoryAddress(root);

        String localPath = (String) cl.getValue(argLocalPath);
        File localFile = app.getPlatformFile(localPath == null ? "." : localPath, false).getCanonicalFile();
        VltContext vCtx = app.createVaultContext(localFile);
        vCtx.setVerbose(cl.hasOption(OPT_VERBOSE));
View Full Code Here

        String type = (String) cl.getValue(optType, "platform");

        String jcrPath = (String) cl.getValue(argJcrPath);
        String localPath = (String) cl.getValue(argLocalPath);
        String root = (String) cl.getValue(argMountpoint);
        RepositoryAddress addr = new RepositoryAddress(root);
        // shift arguments
        if (localPath == null) {
            localPath = jcrPath;
            jcrPath = null;
        }
        if (jcrPath == null) {
            jcrPath = "/";
        }
        if (localPath == null) {
            if (jcrPath .equals("/")) {
                localPath = Text.getName(addr.toString());
            } else {
                localPath = Text.getName(jcrPath);
            }
            if (type.equals("jar")) {
                localPath += "-" + FMT.format(new Date()) + ".jar";
View Full Code Here

    protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception {
        String jcrPath = (String) cl.getValue(argJcrPath);
        String localPath = (String) cl.getValue(argLocalPath);
        String root = (String) cl.getValue(argMountpoint);
        RepositoryAddress addr = new RepositoryAddress(root);

        // shift arguments
        if (localPath == null) {
            localPath = jcrPath;
            jcrPath = null;
        }
        if (jcrPath == null) {
            jcrPath = addr.getPath();
            addr = addr.resolve("/");
        }
        if (localPath == null) {
            if (jcrPath == null) {
                localPath = Text.getName(addr.toString());
            } else {
                localPath = Text.getName(jcrPath);
            }
        }
        if (jcrPath == null || jcrPath.length() == 0 || !jcrPath.startsWith("/")) {
View Full Code Here

*/
public class CmdRcp extends AbstractVaultCommand {

    protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception {
        boolean quiet = cl.hasOption(OPT_QUIET);
        RepositoryAddress src = new RepositoryAddress((String) cl.getValue(srcAddr));
        RepositoryAddress dst = new RepositoryAddress((String) cl.getValue(dstAddr));
        boolean recursive = cl.hasOption(optRecursive);
        RepositoryCopier rcp = new RepositoryCopier();
        if (!quiet) {
            rcp.setTracker(new DefaultProgressListener());
        }
View Full Code Here

        // overwrite this, since it takes the mounted vault fs into account
        String jcrPath = (String) cl.getValue(argJcrPath);
        String localPath = (String) cl.getValue(argLocalPath);

        VaultFile remoteFile = ctx.getVaultFsApp().getVaultFile(jcrPath, true);
        RepositoryAddress addr = remoteFile.getAggregate().getManager().getMountpoint();

        if (localPath == null) {
            if (jcrPath == null) {
                localPath = Text.getName(addr.toString());
            } else {
                localPath = Text.getName(jcrPath);
            }
        }
        File localFile = ctx.getVaultFsApp().getPlatformFile(localPath, false);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void assemble(Session s, ExportOptions opts, OutputStream out)
            throws IOException, RepositoryException {
        RepositoryAddress addr;
        try {
            String mountPath = opts.getMountPath();
            if (mountPath == null || mountPath.length() == 0) {
                mountPath = "/";
            }
            addr = new RepositoryAddress("/" + s.getWorkspace().getName() + mountPath);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
        MetaInf metaInf = opts.getMetaInf();
        if (metaInf == null) {
View Full Code Here

                }

                String rootPath = defNode.getPath();
                DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
                filter.add(new PathFilterSet(rootPath));
                RepositoryAddress addr;
                try {
                    addr = new RepositoryAddress(
                            Text.escapePath("/" + defNode.getSession().getWorkspace().getName() + rootPath));
                } catch (URISyntaxException e) {
                    throw new IllegalArgumentException(e);
                }
                VaultFileSystem jcrfs = Mounter.mount(null, filter, addr, "/definition", defNode.getSession());
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.vault.fs.api.RepositoryAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.