Package org.opensolaris.opengrok.util

Examples of org.opensolaris.opengrok.util.Executor$StreamHandler


        ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
        cmd.add(this.cmd);
        cmd.add("update");
        cmd.add("--trust-server-cert");
        cmd.add("--non-interactive");
        Executor executor = new Executor(cmd, directory);
        if (executor.exec() != 0) {
            throw new IOException(executor.getErrorString());
        }
    }
View Full Code Here


    public DateFormat getDateFormat() {
        return new SimpleDateFormat(datePattern, Locale.US);
    }

    static Boolean checkCmd(String... args) {
        Executor exec = new Executor(args);
        return Boolean.valueOf(exec.exec(false) == 0);
    }
View Full Code Here

     * @return history for the specified file or directory
     * @throws HistoryException if an error happens when parsing the history
     */
    History parse(File file, String changeset) throws HistoryException {
        try {
            Executor executor = repository.getHistoryLogExecutor(file, changeset);
            int status = executor.exec(true, this);

            if (status != 0) {
                throw new HistoryException("Failed to get history for: \"" +
                                           file.getAbsolutePath() + "\" Exit code: " + status);
            }
View Full Code Here

        }
        if (!filename.isEmpty()) {
            cmd.add(filename);
        }

        return new Executor(cmd, new File(directoryName));
    }
View Full Code Here

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

        if (executor.getOutputString().indexOf("paths.default=") != -1) {
            cmd.clear();
            cmd.add(this.cmd);
            cmd.add("pull");
            cmd.add("-u");
            executor = new Executor(cmd, directory);
            if (executor.exec() != 0) {
                throw new IOException(executor.getErrorString());
            }
        }
    }
View Full Code Here

        cmd.add("--no-graph");
        cmd.add("--no-merges");
        cmd.add("--no-format-dates");
        cmd.add(filename);

        return new Executor(cmd, new File(directoryName));
    }
View Full Code Here

            cmd.add(revision);
        }
        cmd.add(file.getName());
        File directory = new File(directoryName);

        Executor executor = new Executor(cmd, directory);
        if (executor.exec() != 0) {
            throw new IOException(executor.getErrorString());
        }

        Annotation ret = null;
        try (BufferedReader in = new BufferedReader(executor.getOutputReader())) {
            ret = new Annotation(file.getName());
            String line;
            String author = null;
            String rev = null;
            while ((line = in.readLine()) != null) {
View Full Code Here

        List<String> cmd = new ArrayList<String>();
        cmd.add(this.cmd);
        cmd.add("pull");
        cmd.add(getQuietOption());
        Executor executor = new Executor(cmd, directory);
        if (executor.exec() != 0) {
            throw new IOException(executor.getErrorString());
        }

        cmd.clear();
        cmd.add(this.cmd);
        cmd.add("update");
        cmd.add(getQuietOption());
        executor = new Executor(cmd, directory);
        if (executor.exec() != 0) {
            throw new IOException(executor.getErrorString());
        }
    }
View Full Code Here

    private ClearCaseRepository repository=new ClearCaseRepository();

    History parse(File file, Repository repos) throws HistoryException {
        repository = (ClearCaseRepository)repos;
        try {
            Executor executor = repository.getHistoryLogExecutor(file);
            int status = executor.exec(true, this);

            if (status != 0) {
                throw new HistoryException("Failed to get history for: \"" +
                                           file.getAbsolutePath() + "\" Exit code: " + status);
            }
View Full Code Here

     */
    History parse(File file, Repository repos, String sinceRevision) throws HistoryException {
        myDir = repos.getDirectoryName() + File.separator;
        repository = (GitRepository) repos;
        try {
            Executor executor = repository.getHistoryLogExecutor(file, sinceRevision);
            int status = executor.exec(true, this);

            if (status != 0) {
                throw new HistoryException("Failed to get history for: \"" +
                        file.getAbsolutePath() + "\" Exit code: " + status);
            }
View Full Code Here

TOP

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

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.