maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r399928 - in /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list: AbstractListCommand.java AbstractListFilesCommand.java ListScmResult.java
Date Fri, 05 May 2006 03:27:16 GMT
Author: carlos
Date: Thu May  4 20:27:15 2006
New Revision: 399928

URL: http://svn.apache.org/viewcvs?rev=399928&view=rev
Log:
[SCM-183] Add list method to ScmProvider

Added:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
  (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java
  (with props)
Removed:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListFilesCommand.java

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java?rev=399928&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
(added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
Thu May  4 20:27:15 2006
@@ -0,0 +1,59 @@
+package org.apache.maven.scm.command.list;
+
+/*
+ * 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.CommandParameter;
+import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.AbstractCommand;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+
+/**
+ * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
+ * @version $Id$
+ */
+public abstract class AbstractListCommand
+    extends AbstractCommand
+{
+    /**
+     * List contents of the remote repository
+     * 
+     * @param repository what to list
+     * @param fileSet the files to list
+     * @param recursive whether list should return subfolder listing
+     * @return the list of files
+     * @throws ScmException
+     */
+    protected abstract ListScmResult executeListCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
+                                                         boolean recursive )
+        throws ScmException;
+
+    public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
+        throws ScmException
+    {
+        if ( fileSet.getFileList().isEmpty() )
+        {
+            throw new IllegalArgumentException( "fileSet can not be empty" );
+        }
+
+        boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE );
+
+        return executeListCommand( repository, fileSet, recursive );
+    }
+}
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java?rev=399928&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java
(added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java
Thu May  4 20:27:15 2006
@@ -0,0 +1,62 @@
+package org.apache.maven.scm.command.list;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.provider.ScmProvider;
+
+/**
+ * Result of {@link ScmProvider#list} operation
+ * 
+ * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
+ * @version $Id$
+ */
+public class ListScmResult
+    extends ScmResult
+{
+    private List files;
+
+    public ListScmResult( String commandLine, String providerMessage, String commandOutput,
boolean success )
+    {
+        super( commandLine, providerMessage, commandOutput, success );
+
+        files = new ArrayList( 0 );
+    }
+
+    public ListScmResult( String commandLine, List files )
+    {
+        super( commandLine, null, null, true );
+
+        this.files = files;
+    }
+
+    public ListScmResult( List files, ScmResult result )
+    {
+        super( result );
+
+        this.files = files;
+    }
+
+    public List getFiles()
+    {
+        return files;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message