Package org.apache.jackrabbit.mk.json

Examples of org.apache.jackrabbit.mk.json.JsopTokenizer.readString()


        while (true) {
            int r = t.read();
            if (r == JsopReader.END) {
                break;
            }
            String path = PathUtils.concat(rootPath, t.readString());
            switch (r) {
                case '+':
                    t.read(':');
                    t.read('{');
                    parseAddNode(commit, t, path);
View Full Code Here


                    break;
                case '>': {
                    // TODO support moving nodes that were modified within this commit
                    t.read(':');
                    String sourcePath = path;
                    String targetPath = t.readString();
                    if (!PathUtils.isAbsolute(targetPath)) {
                        targetPath = PathUtils.concat(rootPath, targetPath);
                    }
                    if (!nodeExists(sourcePath, baseRevId)) {
                        throw new MicroKernelException("Node not found: " + sourcePath + " in revision " + baseRevId);
View Full Code Here

                }
                case '*': {
                    // TODO support copying nodes that were modified within this commit
                    t.read(':');
                    String sourcePath = path;
                    String targetPath = t.readString();
                    if (!PathUtils.isAbsolute(targetPath)) {
                        targetPath = PathUtils.concat(rootPath, targetPath);
                    }
                    if (!nodeExists(sourcePath, baseRevId)) {
                        throw new MicroKernelException("Node not found: " + sourcePath + " in revision " + baseRevId);
View Full Code Here

        tokenizer.read('{');
        for (boolean first = true; !tokenizer.matches('}'); first = false) {
            if (!first) {
                tokenizer.read(',');
            }
            String key = tokenizer.readString();
            tokenizer.read(':');

            List<Pattern> includes = newArrayList();
            List<Pattern> excludes = newArrayList();
            readPatterns(tokenizer, includes, excludes);
View Full Code Here

    private void applyJsop(NodeBuilder builder, String jsonDiff) {
        JsopTokenizer tokenizer = new JsopTokenizer(jsonDiff);
        int token = tokenizer.read();
        while (token != JsopReader.END) {
            String path = tokenizer.readString();
            String name = getName(path);
            switch (token) {
            case '+':
                tokenizer.read(':');
                tokenizer.read('{');
View Full Code Here

                    throw new UnsupportedOperationException();
                }
                break;
            case '>':
                tokenizer.read(':');
                String targetPath = tokenizer.readString();
                NodeBuilder targetParent =
                        getNode(builder, getParentPath(targetPath));
                String targetName = getName(targetPath);
                if (path.equals(targetPath) || PathUtils.isAncestor(path, targetPath)) {
                    throw new MicroKernelException(
View Full Code Here

                    throw new MicroKernelException("Move failed");
                }
                break;
            case '*':
                tokenizer.read(':');
                String copyTarget = tokenizer.readString();
                if (!getNode(builder, path).copyTo(
                        getNode(builder, getParentPath(copyTarget)),
                        getName(copyTarget))) {
                    throw new MicroKernelException("Copy failed");
                }
View Full Code Here

                JsopReader reader = new JsopTokenizer(json);
                reader.read('{');
                properties = new LinkedHashMap<String, PropertyState>();
                childNames = new LinkedHashSet<String>();
                do {
                    String name = StringCache.get(reader.readString());
                    reader.read(':');
                    if (":childNodeCount".equals(name)) {
                        childNodeCount =
                                Long.valueOf(reader.read(JsopReader.NUMBER));
                    } else if (":hash".equals(name)) {
View Full Code Here

                        String json = kernel.getNodes(path, revision, 0,
                                currentOffset, MAX_CHILD_NODE_NAMES, null);
                        JsopReader reader = new JsopTokenizer(json);
                        reader.read('{');
                        do {
                            String name = StringCache.get(reader.readString());
                            reader.read(':');
                            if (reader.matches('{')) {
                                reader.read('}');
                                entries.add(new KernelChildNodeEntry(name));
                            } else if (reader.matches('[')) {
View Full Code Here

        while (true) {
            int r = t.read();
            if (r == JsopReader.END) {
                break;
            }
            String path = PathUtils.concat(rootPath, t.readString());
            switch (r) {
                case '+':
                    t.read(':');
                    t.read('{');
                    parseAddNode(commit, t, path);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.