Package org.opensolaris.opengrok.util

Examples of org.opensolaris.opengrok.util.Executor


        if (repo!=null && !repo.isEmpty())
        {
            argv.add("-p"+repo);
        }

        return new Executor(argv, new File(getDirectoryName()));
    }
View Full Code Here


                argv.add("-v"+rev);
            }
            argv.add("-q");
            argv.add("-tmodify");
            argv.add("-wreplace");
            Executor exec = new Executor(argv, directory);
            int status = exec.exec();

            if (status != 0) {
                OpenGrokLogger.getLogger().log(Level.WARNING,
                    "Failed get revision {2} for: \"{0}\" Exit code: {1}",
                    new Object[]{new File(parent, basename).getAbsolutePath(), String.valueOf(status), rev});
View Full Code Here

            argv.add("-p"+repo);
        }
        if (revision != null) {
            argv.add("-aV:"+revision);
        }
        Executor exec = new Executor(argv, file.getParentFile());
        int status = exec.exec();

        if (status != 0) {
            OpenGrokLogger.getLogger().log(Level.WARNING,
                "Failed annotate for: {2} \"{0}\" Exit code: {1}",
                new Object[]{file.getAbsolutePath(), String.valueOf(status), revision});
        }

        return parseAnnotation(exec.getOutputReader(), file.getName());
    }
View Full Code Here

        argv.add("-r");
        argv.add("-q");
        argv.add("-tmodify");
        argv.add("-wreplace");

        Executor executor = new Executor(argv, directory);
        if (executor.exec() != 0) {
            throw new IOException(executor.getErrorString());
        }
    }
View Full Code Here

        cmd.add("p4");
        cmd.add("changes");
        cmd.add("-t");
        cmd.add("...");

        Executor executor = new Executor(cmd, file.getCanonicalFile());
        executor.exec();
        return parseChanges(executor.getOutputReader());
    }
View Full Code Here

        ArrayList<String> cmd = new ArrayList<String>();
        cmd.add("p4");
        cmd.add("filelog");
        cmd.add("-lt");
        cmd.add(file.getName() + ((rev == null) ? "" : "#"+rev));
        Executor executor = new Executor(cmd, file.getCanonicalFile().getParentFile());
        executor.exec();

        return parseFileLog(executor.getOutputReader());
    }
View Full Code Here

        cmd.add(this.cmd);
        cmd.add("annotate");
        cmd.add("-q");
        cmd.add(file.getPath() + ((rev == null) ? "" : "#" + rev));

        Executor executor = new Executor(cmd, file.getParentFile());
        executor.exec();

        String line;
        int lineno = 0;
        try (BufferedReader reader = new BufferedReader(executor.getOutputReader())) {
            while ((line = reader.readLine()) != null) {
                ++lineno;
                Matcher matcher = annotation_pattern.matcher(line);
                if (matcher.find()) {
                    String revision = matcher.group(1);
View Full Code Here

        ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
        cmd.add(this.cmd);
        cmd.add("print");
        cmd.add("-q");
        cmd.add(basename + ((rev == null) ? "" : "#" + rev));
        Executor executor = new Executor(cmd, new File(parent));
        executor.exec();
        return new ByteArrayInputStream(executor.getOutputString().getBytes());
    }
View Full Code Here

        List<String> cmd = new ArrayList<String>();
        ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
        cmd.add(this.cmd);
        cmd.add("sync");
        Executor executor = new Executor(cmd, directory);
        if (executor.exec() != 0) {
            throw new IOException(executor.getErrorString());
        }
    }
View Full Code Here

                dir = file;
                name = "*";
                cmd.add(testRepo.cmd);
                cmd.add("dirs");
                cmd.add(name);
                Executor executor = new Executor(cmd, dir);
                executor.exec();
            /* OUTPUT:
            stdout: //depot_path/name
            stderr: name - no such file(s).
             */
                status = (executor.getOutputString().indexOf("//") != -1);
            }
            if (!status) {
                cmd.clear();
                cmd.add(testRepo.cmd);
                cmd.add("files");
                cmd.add(name);
                Executor executor = new Executor(cmd, dir);
                executor.exec();
            /* OUTPUT:
            stdout: //depot_path/name
            stderr: name - no such file(s).
             */
                status = (executor.getOutputString().indexOf("//") != -1);
            }
        }
        return status;
    }
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.util.Executor

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.