Author: olamy
Date: Sun Jan  9 14:26:04 2011
New Revision: 1056937

URL: http://svn.apache.org/viewvc?rev=1056937&view=rev
Log:
[SCM-591] Move to Java 1.5 : mkdir command

Modified:
    
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/LoginScmResult.java
    
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/mkdir/MkdirScmResult.java
    
maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/mkdir/LocalMkdirCommand.java
    
maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
    
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirCommand.java
    
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirConsumer.java

Modified: 
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/LoginScmResult.java
URL: 
http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/LoginScmResult.java?rev=1056937&r1=1056936&r2=1056937&view=diff
==============================================================================
--- 
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/LoginScmResult.java
 (original)
+++ 
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/LoginScmResult.java
 Sun Jan  9 14:26:04 2011
@@ -28,6 +28,9 @@ import org.apache.maven.scm.ScmResult;
 public class LoginScmResult
     extends ScmResult
 {
+
+    private static final long serialVersionUID = -179242524702253809L;
+
     public LoginScmResult( String commandLine, String providerMessage, String 
commandOutput, boolean success )
     {
         super( commandLine, providerMessage, commandOutput, success );

Modified: 
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/mkdir/MkdirScmResult.java
URL: 
http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/mkdir/MkdirScmResult.java?rev=1056937&r1=1056936&r2=1056937&view=diff
==============================================================================
--- 
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/mkdir/MkdirScmResult.java
 (original)
+++ 
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/mkdir/MkdirScmResult.java
 Sun Jan  9 14:26:04 2011
@@ -21,6 +21,7 @@ package org.apache.maven.scm.command.mkd
 
 import java.util.List;
 
+import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmResult;
 
 /**
@@ -32,9 +33,12 @@ import org.apache.maven.scm.ScmResult;
 public class MkdirScmResult
     extends ScmResult
 {
+
+    private static final long serialVersionUID = -8717329738246682608L;
+
     private String revision;
     
-    private List createdDirs;
+    private List<ScmFile> createdDirs;
    
     public MkdirScmResult( ScmResult scmResult )
     {
@@ -53,7 +57,7 @@ public class MkdirScmResult
         this.revision = revision;
     }
     
-    public MkdirScmResult( String commandLine, List createdDirs )
+    public MkdirScmResult( String commandLine, List<ScmFile> createdDirs )
     {
         this( commandLine, null, null, true );
         
@@ -67,7 +71,7 @@ public class MkdirScmResult
         this.revision = revision;
     }
     
-    public MkdirScmResult( List createdDirs, ScmResult result )
+    public MkdirScmResult( List<ScmFile> createdDirs, ScmResult result )
     {
         super( result );
         
@@ -79,7 +83,7 @@ public class MkdirScmResult
         return revision;
     }
     
-    public List getCreatedDirs()
+    public List<ScmFile> getCreatedDirs()
     {
         return createdDirs;
     }

Modified: 
maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/mkdir/LocalMkdirCommand.java
URL: 
http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/mkdir/LocalMkdirCommand.java?rev=1056937&r1=1056936&r2=1056937&view=diff
==============================================================================
--- 
maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/mkdir/LocalMkdirCommand.java
 (original)
+++ 
maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/mkdir/LocalMkdirCommand.java
 Sun Jan  9 14:26:04 2011
@@ -49,7 +49,7 @@ public class LocalMkdirCommand
         throws ScmException
     {
         LocalScmProviderRepository repo = (LocalScmProviderRepository) 
repository;
-        List createdDirs = new ArrayList();
+        List<ScmFile> createdDirs = new ArrayList<ScmFile>();
 
         // create/commit the directory directly in the repository
         if ( !createInLocal )
@@ -70,7 +70,7 @@ public class LocalMkdirCommand
                 }
 
                 FileUtils.mkdir( dir.getAbsolutePath() );
-                createdDirs.add( new ScmFile( dir.getPath(), 
ScmFileStatus.CHECKED_IN ) );
+                createdDirs.add( new ScmFile( dir.getPath(), 
ScmFileStatus.ADDED ) );
             }
         }
         else

Modified: 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
URL: 
http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java?rev=1056937&r1=1056936&r2=1056937&view=diff
==============================================================================
--- 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
 (original)
+++ 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/mkdir/AbstractCvsMkdirCommand.java
 Sun Jan  9 14:26:04 2011
@@ -19,10 +19,16 @@ package org.apache.maven.scm.provider.cv
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
 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.Command;
 import org.apache.maven.scm.command.mkdir.AbstractMkdirCommand;
@@ -58,8 +64,16 @@ public abstract class AbstractCvsMkdirCo
             return new MkdirScmResult( addResult.getCommandLine().toString(), 
"The cvs command failed.",
                                        addResult.getCommandOutput(), false );
         }
+        
+        List<ScmFile> addedFiles = new ArrayList<ScmFile>();
+        
+        for (File file : fileSet.getFileList()) 
+        {
+            ScmFile scmFile = new ScmFile( file.getPath(), ScmFileStatus.ADDED 
);
+            addedFiles.add( scmFile );
+        }
 
-        return new MkdirScmResult( addResult.getCommandLine().toString(), 
fileSet.getFileList() );
+        return new MkdirScmResult( addResult.getCommandLine().toString(), 
addedFiles );
     }
 
     protected abstract Command getAddCommand();

Modified: 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirCommand.java
URL: 
http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirCommand.java?rev=1056937&r1=1056936&r2=1056937&view=diff
==============================================================================
--- 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirCommand.java
 (original)
+++ 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirCommand.java
 Sun Jan  9 14:26:04 2011
@@ -118,7 +118,7 @@ public class SvnMkdirCommand
 
         cl.createArg().setValue( "mkdir" );
 
-        Iterator it = fileSet.getFileList().iterator();
+        Iterator<File> it = fileSet.getFileList().iterator();
         String dirPath = ( (File) it.next() ).getPath();
         // replacing \ with / for windauze
         if ( dirPath != null && Os.isFamily( Os.FAMILY_DOS ) )

Modified: 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirConsumer.java
URL: 
http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirConsumer.java?rev=1056937&r1=1056936&r2=1056937&view=diff
==============================================================================
--- 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirConsumer.java
 (original)
+++ 
maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/mkdir/SvnMkdirConsumer.java
 Sun Jan  9 14:26:04 2011
@@ -41,7 +41,7 @@ public class SvnMkdirConsumer
 
     private int revision;
     
-    private List createdDirs = new ArrayList();
+    private List<ScmFile> createdDirs = new ArrayList<ScmFile>();
     
     public SvnMkdirConsumer( ScmLogger logger )
     {
@@ -91,7 +91,7 @@ public class SvnMkdirConsumer
         return revision;
     }
     
-    public List getCreatedDirs()
+    public List<ScmFile> getCreatedDirs()
     {
         return createdDirs;
     }


Reply via email to