01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12:
13: package org.tmatesoft.svn.cli.command;
14:
15: import java.io.File;
16: import java.io.InputStream;
17: import java.io.PrintStream;
18:
19: import org.tmatesoft.svn.cli.SVNArgument;
20: import org.tmatesoft.svn.cli.SVNCommand;
21: import org.tmatesoft.svn.core.SVNException;
22: import org.tmatesoft.svn.core.wc.SVNWCClient;
23:
24: /**
25: * @version 1.1.1
26: * @author TMate Software Ltd.
27: */
28: public class SVNResolvedCommand extends SVNCommand {
29:
30: public void run(InputStream in, PrintStream out, PrintStream err)
31: throws SVNException {
32: run(out, err);
33: }
34:
35: public void run(final PrintStream out, PrintStream err)
36: throws SVNException {
37: final boolean recursive = getCommandLine().hasArgument(
38: SVNArgument.RECURSIVE);
39: getClientManager().setEventHandler(
40: new SVNCommandEventProcessor(out, err, false));
41: SVNWCClient wcClient = getClientManager().getWCClient();
42: boolean error = false;
43: for (int i = 0; i < getCommandLine().getPathCount(); i++) {
44: final String absolutePath = getCommandLine().getPathAt(i);
45: try {
46: wcClient.doResolve(new File(absolutePath), recursive);
47: } catch (SVNException e) {
48: err.println(e.getMessage());
49: error = true;
50: }
51: }
52: if (error) {
53: System.exit(1);
54: }
55: }
56: }
|