maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r381101 [1/4] - in /maven/scm/trunk/sandbox/maven-scm-provider-svnjava: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/scm/ src/main/java/org/apac...
Date Sun, 26 Feb 2006 15:05:58 GMT
Author: evenisse
Date: Sun Feb 26 07:05:52 2006
New Revision: 381101

URL: http://svn.apache.org/viewcvs?rev=381101&view=rev
Log:
[SCM-13] pure Java SVN interface
Submitted by David Hawkins

It's in sandbox until 1.0.4 of javasvn will be release, so we'll can use file protocol and test it with TCK.

Added:
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnJavaUtil.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnStatusHandler.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/resources/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/resources/META-INF/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/resources/META-INF/plexus/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/resources/META-INF/plexus/components.xml   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaTestUtils.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/SvnJavaTckTestCommand.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommandTckTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommandTckTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommandTckTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/status/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommandTckTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommandTckTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/update/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommandTckTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/repository/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnScmProviderRepositoryTest.java   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/checkout.dump
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/svn/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/svn-test.properties   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/svn/changelog/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/svn/changelog/svnlog.txt   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/svn/changelog/svnlog2.txt   (with props)
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/tck/
    maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/test/resources/tck/tck.dump

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Feb 26 07:05:52 2006
@@ -0,0 +1,4 @@
+maven-scm-provider-svnjava.iws
+target
+maven-scm-provider-svnjava.iml
+maven-scm-provider-svnjava.ipr

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml Sun Feb 26 07:05:52 2006
@@ -0,0 +1,45 @@
+<project>
+  <parent>
+    <artifactId>maven-scm-providers-svn</artifactId>
+    <groupId>org.apache.maven.scm</groupId>
+    <version>1.0-beta-3-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>maven-scm-provider-svnjava</artifactId>
+  <name>Maven SCM Subversion Provider - Java Impl.</name>
+  <version>1.0-beta-3-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <!-- 
+          For information on testing this module, see the documentation in:
+          org.apache.maven.scm.provider.svn.svnjava.SvnTestUtils.java
+        -->
+        <configuration>
+          <excludes>
+            <exclude>**/*TckTest.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-svn-commons</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.tmate</groupId>
+      <artifactId>javasvn</artifactId>
+      <version>1.0.3</version>
+    </dependency>
+    <!-- dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.0</version>
+    </dependency -->
+  </dependencies>
+</project>

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,146 @@
+package org.apache.maven.scm.provider.svn.svnjava;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.AbstractSvnScmProvider;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.add.SvnAddCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.changelog.SvnChangeLogCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.checkin.SvnCheckInCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.checkout.SvnCheckOutCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.diff.SvnDiffCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.remove.SvnRemoveCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.status.SvnStatusCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.tag.SvnTagCommand;
+import org.apache.maven.scm.provider.svn.svnjava.command.update.SvnUpdateCommand;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+import org.codehaus.plexus.util.StringUtils;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
+import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
+
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:dh-maven@famhq.com">David Hawkins</a>
+ * @version $Id$
+ */
+public class SvnJavaScmProvider
+    extends AbstractSvnScmProvider
+{
+    public static final String COMMAND_LINE = "JavaSVN Library";
+
+    private static boolean initialized = false;
+
+    public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter )
+        throws ScmRepositoryException
+    {
+        initialize();
+
+        try
+        {
+            SVNURL url = SVNURL.parseURIEncoded( scmSpecificUrl );
+
+            // The existing svn provider pattern is to strip the username (if any)
+            // from the url.
+            String strUrl = url.toString();
+            if ( url.getUserInfo() != null )
+            {
+                strUrl = StringUtils.replace( strUrl, url.getUserInfo() + "@", "" );
+            }
+
+            return new SvnJavaScmProviderRepository( url, strUrl );
+        }
+        catch ( SVNException e )
+        {
+            throw new ScmRepositoryException( "The scm url is invalid: " + e.getMessage(),
+                                              Collections.singletonList( e.getMessage() ) );
+        }
+    }
+
+    protected SvnCommand getAddCommand()
+    {
+        return new SvnAddCommand();
+    }
+
+    protected SvnCommand getChangeLogCommand()
+    {
+        return new SvnChangeLogCommand();
+    }
+
+    protected SvnCommand getCheckInCommand()
+    {
+        return new SvnCheckInCommand();
+    }
+
+    protected SvnCommand getCheckOutCommand()
+    {
+        return new SvnCheckOutCommand();
+    }
+
+    protected SvnCommand getDiffCommand()
+    {
+        return new SvnDiffCommand();
+    }
+
+    protected SvnCommand getRemoveCommand()
+    {
+        return new SvnRemoveCommand();
+    }
+
+    protected SvnCommand getStatusCommand()
+    {
+        return new SvnStatusCommand();
+    }
+
+    protected SvnCommand getTagCommand()
+    {
+        return new SvnTagCommand();
+    }
+
+    protected SvnCommand getUpdateCommand()
+    {
+        return new SvnUpdateCommand();
+    }
+
+    /*
+     * Initializes the library to work with a repository either via svn:// (and
+     * svn+ssh://) or via http:// (and https://)
+     */
+    private static void initialize()
+    {
+        if ( initialized )
+        {
+            return;
+        }
+
+        /*
+        * for DAV (over http and https)
+        */
+        DAVRepositoryFactory.setup();
+
+        /*
+        * for svn (over svn and svn+ssh)
+        */
+        SVNRepositoryFactoryImpl.setup();
+
+        initialized = true;
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/SvnJavaScmProvider.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,109 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.add;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.add.AbstractAddCommand;
+import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.tmatesoft.svn.core.SVNCancelException;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.wc.ISVNEventHandler;
+import org.tmatesoft.svn.core.wc.SVNClientManager;
+import org.tmatesoft.svn.core.wc.SVNEvent;
+import org.tmatesoft.svn.core.wc.SVNEventAction;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @author <a href="mailto:dh-maven@famhq.com">David Hawkins</a>
+ * @version $Id$
+ */
+public class SvnAddCommand
+    extends AbstractAddCommand
+    implements SvnCommand
+{
+    protected ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message,
+                                           boolean binary )
+        throws ScmException
+    {
+        if ( fileSet.getFiles().length == 0 )
+        {
+            throw new ScmException( "You must provide at least one file/directory to add" );
+        }
+
+        final List filesAdded = new ArrayList();
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repository;
+
+        SVNClientManager clientManager = javaRepo.getClientManager();
+
+        try
+        {
+            clientManager.getWCClient().setEventHandler( new ISVNEventHandler()
+            {
+
+                public void handleEvent( SVNEvent event, double progress )
+                {
+                    if ( event.getAction() == SVNEventAction.ADD )
+                    {
+                        filesAdded.add( event.getFile() );
+                    }
+                }
+
+                public void checkCancelled()
+                    throws SVNCancelException
+                {
+                    // null
+                }
+            } );
+
+            File[] files = fileSet.getFiles();
+
+            for ( int i = 0; i < files.length; i++ )
+            {
+                File fileToAdd = new File( fileSet.getBasedir(), files[i].toString() );
+
+                getLogger().debug( "SVN adding file: " + fileToAdd.getAbsolutePath() );
+
+                SvnJavaUtil.add( clientManager, fileToAdd, false );
+            }
+        }
+        catch ( SVNException e )
+        {
+            return new AddScmResult( SvnJavaScmProvider.COMMAND_LINE, "The svn operation failed.", e.getMessage(),
+                                     false );
+        }
+        finally
+        {
+            clientManager.getWCClient().setEventHandler( null );
+        }
+
+        return new AddScmResult( null, filesAdded );
+    }
+
+
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/add/SvnAddCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,122 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.changelog;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ChangeFile;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand;
+import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
+import org.apache.maven.scm.command.changelog.ChangeLogSet;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.SvnChangeSet;
+import org.apache.maven.scm.provider.svn.SvnTagBranchUtils;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.tmatesoft.svn.core.ISVNLogEntryHandler;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNLogEntry;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.SVNRevision;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class SvnChangeLogCommand
+    extends AbstractChangeLogCommand
+    implements SvnCommand
+{
+    protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet,
+                                                          Date startDate, Date endDate, String branch,
+                                                          String datePattern )
+        throws ScmException
+    {
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        SVNRevision startRevision = ( startDate != null ) ? SVNRevision.create( startDate ) : SVNRevision.PREVIOUS;
+        SVNRevision endRevision = ( endDate != null ) ? SVNRevision.create( endDate ) : SVNRevision.HEAD;
+
+        try
+        {
+            SVNURL url = javaRepo.getSvnUrl();
+
+            if ( branch != null )
+            {
+                url = SVNURL.parseURIEncoded( SvnTagBranchUtils.resolveBranchUrl( javaRepo, url.toString() ) );
+            }
+
+            ChangeLogHandler handler = new ChangeLogHandler( startDate, endDate );
+
+            SvnJavaUtil.changelog( javaRepo.getClientManager(), url, startRevision, endRevision, true, // stopOnCopy
+                                   true, // reportPaths
+                                   handler );
+
+            return new ChangeLogScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getChangeSets() );
+        }
+        catch ( SVNException e )
+        {
+            return new ChangeLogScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN Changelog failed.", e.getMessage(),
+                                           false );
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    protected static class ChangeLogHandler
+        implements ISVNLogEntryHandler
+    {
+        private ChangeLogSet changeLogSet;
+
+        private List changeSets = new ArrayList();
+
+        public ChangeLogHandler( Date startDate, Date endDate )
+        {
+            changeLogSet = new ChangeLogSet( startDate, endDate );
+        }
+
+        public void handleLogEntry( SVNLogEntry logEntry )
+            throws SVNException
+        {
+            List changedFiles = new ArrayList();
+
+            for ( Iterator i = logEntry.getChangedPaths().keySet().iterator(); i.hasNext(); )
+            {
+                changedFiles.add( new ChangeFile( (String) i.next() ) );
+            }
+
+            changeSets.add(
+                new SvnChangeSet( logEntry.getDate(), logEntry.getMessage(), logEntry.getAuthor(), changedFiles ) );
+        }
+
+        public ChangeLogSet getChangeSets()
+        {
+            changeLogSet.setChangeSets( changeSets );
+
+            return changeLogSet;
+        }
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/changelog/SvnChangeLogCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,115 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.checkin;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.command.checkin.AbstractCheckInCommand;
+import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.codehaus.plexus.util.StringUtils;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNNodeKind;
+import org.tmatesoft.svn.core.wc.SVNEvent;
+import org.tmatesoft.svn.core.wc.SVNEventAction;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id$
+ */
+public class SvnCheckInCommand
+    extends AbstractCheckInCommand
+    implements SvnCommand
+{
+    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
+                                                      String tag )
+        throws ScmException
+    {
+        if ( StringUtils.isNotEmpty( tag ) )
+        {
+            throw new ScmException( "This provider can't handle tags." );
+        }
+
+        getLogger().info( "SVN commit directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        SvnJavaUtil.GenericEventHandler handler = new SvnJavaUtil.GenericEventHandler();
+
+        javaRepo.getClientManager().getCommitClient().setEventHandler( handler );
+
+        try
+        {
+            File[] tmpPaths = fileSet.getFiles();
+            File[] paths;
+            if ( tmpPaths == null || tmpPaths.length == 0 )
+            {
+                paths = new File[]{fileSet.getBasedir()};
+            }
+            else
+            {
+                paths = new File[tmpPaths.length];
+                for ( int i = 0; i < tmpPaths.length; i++ )
+                {
+                    if ( tmpPaths[i].isAbsolute() )
+                    {
+                        paths[i] = tmpPaths[i];
+                    }
+                    else
+                    {
+                        paths[i] = new File( fileSet.getBasedir(), tmpPaths[i].toString() );
+                    }
+                }
+            }
+
+            SvnJavaUtil.commit( javaRepo.getClientManager(), paths, false, message, true );
+
+            List files = new ArrayList();
+            for ( Iterator iter = handler.getEvents().iterator(); iter.hasNext(); )
+            {
+                SVNEvent event = (SVNEvent) iter.next();
+                if ( event.getExpectedAction() != SVNEventAction.COMMIT_COMPLETED &&
+                    event.getExpectedAction() != SVNEventAction.COMMIT_DELTA_SENT &&
+                    event.getNodeKind() == SVNNodeKind.FILE )
+                {
+                    files.add( new ScmFile( event.getFile().toString(), ScmFileStatus.CHECKED_IN ) );
+                }
+            }
+
+            return new CheckInScmResult( SvnJavaScmProvider.COMMAND_LINE, files );
+        }
+        catch ( SVNException e )
+        {
+            return new CheckInScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN commit failed.", e.getMessage(), false );
+        }
+        finally
+        {
+            javaRepo.getClientManager().getCommitClient().setEventHandler( null );
+        }
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkin/SvnCheckInCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,81 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.checkout;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.SvnTagBranchUtils;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.ScmFileEventHandler;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.SVNRevision;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class SvnCheckOutCommand
+    extends AbstractCheckOutCommand
+    implements SvnCommand
+{
+    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag )
+        throws ScmException
+    {
+        getLogger().info( "SVN checkout directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;
+
+        String url = repository.getUrl();
+        if ( tag != null )
+        {
+            url = SvnTagBranchUtils.resolveTagUrl( repository, tag );
+        }
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        ScmFileEventHandler handler = new ScmFileEventHandler( getLogger() );
+
+        javaRepo.getClientManager().getUpdateClient().setEventHandler( handler );
+
+        try
+        {
+            SvnJavaUtil.checkout( javaRepo.getClientManager(), SVNURL.parseURIEncoded( url ), SVNRevision.HEAD, fileSet
+                .getBasedir(), true );
+
+            return new CheckOutScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles() );
+        }
+        catch ( SVNException e )
+        {
+            return new CheckOutScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN checkout failed.", e.getMessage(),
+                                          false );
+        }
+        finally
+        {
+            javaRepo.getClientManager().getUpdateClient().setEventHandler( null );
+        }
+    }
+
+
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/checkout/SvnCheckOutCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,97 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.diff;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.diff.AbstractDiffCommand;
+import org.apache.maven.scm.command.diff.DiffScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.command.diff.SvnDiffConsumer;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.ScmFileEventHandler;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.wc.SVNRevision;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id$
+ */
+public class SvnDiffCommand
+    extends AbstractDiffCommand
+    implements SvnCommand
+{
+    protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, String startRevision,
+                                                String endRevision )
+        throws ScmException
+    {
+        getLogger().info( "SVN diff directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        ScmFileEventHandler handler = new ScmFileEventHandler( getLogger() );
+
+        try
+        {
+            javaRepo.getClientManager().getDiffClient().setEventHandler( handler );
+
+            SVNRevision start = ( startRevision == null ) ? SVNRevision.COMMITTED : SVNRevision.parse( startRevision );
+            SVNRevision end = ( endRevision == null ) ? SVNRevision.WORKING : SVNRevision.parse( endRevision );
+
+            ByteArrayOutputStream out =
+                SvnJavaUtil.diff( javaRepo.getClientManager(), fileSet.getBasedir(), start, end );
+
+            SvnDiffConsumer consumer = new SvnDiffConsumer( getLogger(), fileSet.getBasedir() );
+
+            ByteArrayInputStream bis = new ByteArrayInputStream( out.toByteArray() );
+
+            BufferedReader in = new BufferedReader( new InputStreamReader( bis ) );
+
+            String line = in.readLine();
+            while ( line != null )
+            {
+                consumer.consumeLine( line );
+
+                line = in.readLine();
+            }
+
+            return new DiffScmResult( SvnJavaScmProvider.COMMAND_LINE, consumer.getChangedFiles(),
+                                      consumer.getDifferences(), consumer.getPatch() );
+        }
+        catch ( IOException e )
+        {
+            return new DiffScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN diff failed.", e.getMessage(), false );
+        }
+        catch ( SVNException e )
+        {
+            return new DiffScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN diff failed.", e.getMessage(), false );
+        }
+        finally
+        {
+            javaRepo.getClientManager().getDiffClient().setEventHandler( null );
+        }
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/diff/SvnDiffCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,71 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.remove;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.remove.AbstractRemoveCommand;
+import org.apache.maven.scm.command.remove.RemoveScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.ScmFileEventHandler;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.tmatesoft.svn.core.SVNException;
+
+/**
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id$
+ */
+public class SvnRemoveCommand
+    extends AbstractRemoveCommand
+    implements SvnCommand
+{
+    protected ScmResult executeRemoveCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message )
+        throws ScmException
+    {
+        if ( fileSet.getFiles().length == 0 )
+        {
+            throw new ScmException( "You must provide at least one file/directory to remove" );
+        }
+
+        getLogger().info( "SVN remove working directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        ScmFileEventHandler handler = new ScmFileEventHandler( getLogger() );
+
+        javaRepo.getClientManager().getWCClient().setEventHandler( handler );
+
+        try
+        {
+            SvnJavaUtil.delete( javaRepo.getClientManager(), fileSet.getFiles(), true );
+
+            return new RemoveScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles() );
+        }
+        catch ( SVNException e )
+        {
+            return new RemoveScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN remove failed.", e.getMessage(), false );
+        }
+        finally
+        {
+            javaRepo.getClientManager().getWCClient().setEventHandler( null );
+        }
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/remove/SvnRemoveCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,61 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.status;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.status.AbstractStatusCommand;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnStatusHandler;
+import org.tmatesoft.svn.core.SVNException;
+
+/**
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id$
+ */
+public class SvnStatusCommand
+    extends AbstractStatusCommand
+    implements SvnCommand
+{
+    protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet )
+        throws ScmException
+    {
+        getLogger().info( "SVN status directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        SvnStatusHandler handler = new SvnStatusHandler();
+
+        try
+        {
+            SvnJavaUtil.status( javaRepo.getClientManager(), fileSet.getBasedir(), true, // isRecursive
+                                true, // isRemote                                 
+                                handler );
+
+            return new StatusScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles() );
+        }
+        catch ( SVNException e )
+        {
+            return new StatusScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN status failed.", e.getMessage(), false );
+        }
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/status/SvnStatusCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,111 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.tag;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.tag.AbstractTagCommand;
+import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.SvnTagBranchUtils;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.codehaus.plexus.util.FileUtils;
+import org.tmatesoft.svn.core.SVNCommitInfo;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id$
+ * @todo since this is just a copy, use that instead.
+ */
+public class SvnTagCommand
+    extends AbstractTagCommand
+    implements SvnCommand
+{
+    public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag )
+        throws ScmException
+    {
+        if ( tag == null )
+        {
+            throw new ScmException( "tag must be specified" );
+        }
+
+        if ( fileSet.getFiles().length != 0 )
+        {
+            throw new ScmException( "This provider doesn't support tagging subsets of a directory" );
+        }
+
+        getLogger().info( "SVN checkout directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        try
+        {
+            SVNURL destURL = SVNURL.parseURIEncoded( SvnTagBranchUtils.resolveTagUrl( repository, tag ) );
+
+            SVNCommitInfo info = SvnJavaUtil.copy( javaRepo.getClientManager(), javaRepo.getSvnUrl(), destURL, false,
+                                                   "[maven-scm] copy for tag " + tag );
+
+            if ( info.getError() != null )
+            {
+                return new TagScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN tag failed.",
+                                         info.getError().getMessage(), false );
+            }
+
+            // The copy command doesn't return a list of files that were tagged, 
+            // so manually build the list from the contents of the fileSet.getBaseDir.
+            List fileList = new ArrayList();
+            List files = null;
+            try
+            {
+                files = FileUtils.getFiles( fileSet.getBasedir(), "**", "**/.svn/**", false );
+            }
+            catch ( IOException e )
+            {
+                throw new ScmException( "Error while building list of tagged files.", e );
+            }
+
+            for ( Iterator i = files.iterator(); i.hasNext(); )
+            {
+                File f = (File) i.next();
+                fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
+            }
+
+            return new TagScmResult( SvnJavaScmProvider.COMMAND_LINE, fileList );
+        }
+        catch ( SVNException e )
+        {
+            return new TagScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN tag failed.", e.getMessage(), false );
+        }
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,111 @@
+package org.apache.maven.scm.provider.svn.svnjava.command.update;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.changelog.ChangeLogCommand;
+import org.apache.maven.scm.command.update.AbstractUpdateCommand;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.SvnTagBranchUtils;
+import org.apache.maven.scm.provider.svn.command.SvnCommand;
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.SvnJavaScmProvider;
+import org.apache.maven.scm.provider.svn.svnjava.command.changelog.SvnChangeLogCommand;
+import org.apache.maven.scm.provider.svn.svnjava.repository.SvnJavaScmProviderRepository;
+import org.apache.maven.scm.provider.svn.svnjava.util.ScmFileEventHandler;
+import org.apache.maven.scm.provider.svn.svnjava.util.SvnJavaUtil;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.SVNRevision;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class SvnUpdateCommand
+    extends AbstractUpdateCommand
+    implements SvnCommand
+{
+
+    protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag )
+        throws ScmException
+    {
+        SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;
+
+        getLogger().info( "SVN update directory: " + fileSet.getBasedir().getAbsolutePath() );
+
+        SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
+
+        try
+        {
+            ScmFileEventHandler handler = new ScmFileEventHandler( getLogger() );
+
+            javaRepo.getClientManager().getUpdateClient().setEventHandler( handler );
+
+            if ( tag == null || SvnTagBranchUtils.isRevisionSpecifier( tag ) )
+            {
+                SvnJavaUtil.update( javaRepo.getClientManager(), fileSet.getBasedir(), getSVNRevision( tag ), true );
+            }
+            else
+            {
+                // The tag specified does not appear to be numeric, so assume it refers 
+                // to a branch/tag url and perform a switch operation rather than update
+                SvnJavaUtil.switchToURL( javaRepo.getClientManager(), fileSet.getBasedir(),
+                                         SVNURL.parseURIEncoded( SvnTagBranchUtils.resolveTagUrl( repository, tag ) ),
+                                         SVNRevision.HEAD, true );
+            }
+
+            return new UpdateScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles() );
+        }
+        catch ( SVNException e )
+        {
+            return new UpdateScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN update failed.", e.getMessage(), false );
+        }
+        finally
+        {
+            javaRepo.getClientManager().getUpdateClient().setEventHandler( null );
+        }
+    }
+
+    private static SVNRevision getSVNRevision( String revision )
+    {
+        if ( revision == null || !SvnTagBranchUtils.isRevisionSpecifier( revision ) )
+        {
+            return SVNRevision.HEAD;
+        }
+        else
+        {
+            return SVNRevision.parse( revision );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.command.update.AbstractUpdateCommand#getChangeLogCommand()
+     */
+    protected ChangeLogCommand getChangeLogCommand()
+    {
+        SvnChangeLogCommand command = new SvnChangeLogCommand();
+
+        command.setLogger( getLogger() );
+
+        return command;
+    }
+
+
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/update/SvnUpdateCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,134 @@
+package org.apache.maven.scm.provider.svn.svnjava.repository;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.wc.ISVNOptions;
+import org.tmatesoft.svn.core.wc.SVNClientManager;
+import org.tmatesoft.svn.core.wc.SVNWCUtil;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class SvnJavaScmProviderRepository
+    extends SvnScmProviderRepository
+{
+    private SVNURL svnUrl;
+
+    private SVNClientManager clientManager;
+
+    public SvnJavaScmProviderRepository( SVNURL svnUrl, String strUrl )
+    {
+        super( strUrl, null, null );
+
+        setUser( svnUrl.getUserInfo() );
+
+        setPassword( null );
+
+        this.svnUrl = svnUrl;
+
+        if ( getUser() != null )
+        {
+            System.getProperties().setProperty( "javasvn.ssh2.username", getUser() );
+        }
+        if ( getPassword() != null )
+        {
+            System.getProperties().setProperty( "javasvn.ssh2.password", getPassword() );
+        }
+
+        initializeClientManager();
+    }
+
+    public SVNURL getSvnUrl()
+    {
+        return svnUrl;
+    }
+
+    public SVNClientManager getClientManager()
+    {
+        return clientManager;
+    }
+
+    public void setPrivateKey( String privateKey )
+    {
+        super.setPrivateKey( privateKey );
+
+        if ( getPrivateKey() != null )
+        {
+            System.getProperties().setProperty( "javasvn.ssh2.key", getPrivateKey() );
+        }
+
+        initializeClientManager();
+    }
+
+    public void setPassphrase( String passphrase )
+    {
+        super.setPassphrase( passphrase );
+
+        if ( getPassphrase() != null )
+        {
+            System.getProperties().setProperty( "javasvn.ssh2.passphrase", getPassphrase() );
+        }
+
+        initializeClientManager();
+    }
+
+    public void setUser( String user )
+    {
+        super.setUser( user );
+
+        if ( getUser() != null )
+        {
+            System.getProperties().setProperty( "javasvn.ssh2.username", getUser() );
+        }
+
+        initializeClientManager();
+    }
+
+    public void setPassword( String password )
+    {
+        super.setPassword( password );
+
+        if ( getPassword() != null )
+        {
+            System.getProperties().setProperty( "javasvn.ssh2.password", getPassword() );
+        }
+
+        initializeClientManager();
+    }
+
+    private void initializeClientManager()
+    {
+        /*
+        * Creates a default run-time configuration options driver. Default options
+        * created in this way use the Subversion run-time configuration area (for
+        * instance, on a Windows platform it can be found in the '%APPDATA%\Subversion'
+        * directory).
+        *
+        * readonly = true - not to save  any configuration changes that can be done
+        * during the program run to a config file (config settings will only
+        * be read to initialize; to enable changes the readonly flag should be set
+        * to false).
+        *
+        */
+        ISVNOptions options = SVNWCUtil.createDefaultOptions( true );
+
+        clientManager = SVNClientManager.newInstance( options, SVNWCUtil.createDefaultAuthenticationManager() );
+    }
+}

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/repository/SvnJavaScmProviderRepository.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java?rev=381101&view=auto
==============================================================================
--- maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java (added)
+++ maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java Sun Feb 26 07:05:52 2006
@@ -0,0 +1,103 @@
+package org.apache.maven.scm.provider.svn.svnjava.util;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.codehaus.plexus.util.StringUtils;
+import org.tmatesoft.svn.core.SVNCancelException;
+import org.tmatesoft.svn.core.SVNNodeKind;
+import org.tmatesoft.svn.core.wc.ISVNEventHandler;
+import org.tmatesoft.svn.core.wc.SVNEvent;
+import org.tmatesoft.svn.core.wc.SVNEventAction;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * {@link org.tmatesoft.svn.core.wc.ISVNStatusHandler} implementation for most
+ * scm commands.  Creates a list of {@link org.apache.maven.scm.ScmFile} objects and determines
+ * the {@link org.apache.maven.scm.ScmFileStatus} from the
+ * {@link org.tmatesoft.svn.core.wc.SVNEvent#getExpectedAction()}.
+ *
+ * @author <a href="mailto:dh-maven@famhq.com">David Hawkins</a>
+ * @version $Id$
+ */
+public class ScmFileEventHandler
+    implements ISVNEventHandler
+{
+    private final ScmLogger logger;
+
+    private final List files = new ArrayList();
+
+    /**
+     * The logger is used in alerting the user to unknown file statuses.
+     */
+    public ScmFileEventHandler( ScmLogger logger )
+    {
+        this.logger = logger;
+    }
+
+    /**
+     * Creates a {@link ScmFile} for each event with the exception of directories.
+     * Directory events are ignored.
+     */
+    public void handleEvent( SVNEvent event, double progress )
+    {
+        ScmFileStatus status = SvnJavaUtil.getScmFileStatus( event.getExpectedAction() );
+
+        // Do nothing for events without files
+        if ( event.getFile() == null || event.getExpectedAction() == SVNEventAction.COMMIT_DELTA_SENT ||
+            event.getExpectedAction() == SVNEventAction.COMMIT_COMPLETED || event.getNodeKind() != SVNNodeKind.FILE )
+        {
+            return;
+        }
+
+        if ( status == null )
+        {
+            logger.info( "Unknown SVN file status: '" + event.getExpectedAction() + "' for file: " +
+                event.getFile().getAbsolutePath() );
+
+            status = ScmFileStatus.UNKNOWN;
+        }
+
+        if ( logger.isDebugEnabled() )
+        {
+            logger.debug( StringUtils.defaultString( status, event.getContentsStatus().toString() ) + " - " +
+                event.getFile().getAbsolutePath() );
+        }
+
+        files.add( new ScmFile( event.getFile().toString(), status ) );
+    }
+
+    public void checkCancelled()
+        throws SVNCancelException
+    {
+        // null
+    }
+
+    /**
+     * Returns the list of files collected from handling events.
+     *
+     * @return a list of {@link ScmFile} objects
+     */
+    public List getFiles()
+    {
+        return files;
+    }
+}
\ No newline at end of file

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/sandbox/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/ScmFileEventHandler.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message