0N/A/*
0N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
407N/A * Common Development and Distribution License (the "License").
0N/A * You may not use this file except in compliance with the License.
0N/A *
0N/A * See LICENSE.txt included in this distribution for the specific
0N/A * language governing permissions and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at LICENSE.txt.
0N/A * If applicable, add the following below this CDDL HEADER, with the
0N/A * fields enclosed by brackets "[]" replaced with your own identifying
0N/A * information: Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A */
0N/A
0N/A/*
263N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
0N/A * Use is subject to license terms.
0N/A */
0N/Apackage org.opensolaris.opengrok.history;
0N/A
263N/Aimport java.io.File;
263N/Aimport java.io.IOException;
263N/Aimport java.io.InputStream;
263N/Aimport java.util.ArrayList;
542N/Aimport org.opensolaris.opengrok.util.Executor;
0N/A
212N/A
439N/Apublic final class SCCSget {
1190N/A
285N/A public static InputStream getRevision(String command, File file, String revision) throws IOException {
263N/A InputStream ret = null;
212N/A ArrayList<String> argv = new ArrayList<String>();
212N/A argv.add(command);
212N/A argv.add("get");
212N/A argv.add("-p");
212N/A if (revision != null) {
807N/A argv.add("-r"+revision);
263N/A }
263N/A argv.add(file.getCanonicalPath());
263N/A
542N/A Executor executor = new Executor(argv);
542N/A if (executor.exec() == 0) {
542N/A ret = executor.getOutputStream();
0N/A }
263N/A
263N/A return ret;
0N/A }
212N/A
263N/A private SCCSget() {
0N/A }
0N/A}