maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1162334 [3/4] - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity: ./ src/main/java/org/apache/maven/scm/provider/integrity/ src/main/java/org/apache/maven/scm/provider/integrity/command/add/ src/main/java/org/apache/mav...
Date Sat, 27 Aug 2011 12:39:22 GMT
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/add/IntegrityAddCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/add/IntegrityAddCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/add/IntegrityAddCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/add/IntegrityAddCommand.java Sat Aug 27 12:39:21 2011
@@ -36,24 +36,35 @@ import java.util.List;
  *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
  * @version $Id: IntegrityAddCommand.java 1.4 2011/08/22 13:06:13EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityAddCommand extends AbstractAddCommand {
+public class IntegrityAddCommand
+    extends AbstractAddCommand
+{
     /**
      * {@inheritDoc}
      */
     @Override
-    public AddScmResult executeAddCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary) throws ScmException {
-        getLogger().info("Attempting to add new files from directory " + fileSet.getBasedir().getAbsolutePath());
+    public AddScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message,
+                                           boolean binary )
+        throws ScmException
+    {
+        getLogger().info( "Attempting to add new files from directory " + fileSet.getBasedir().getAbsolutePath() );
         IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
         Sandbox siSandbox = iRepo.getSandbox();
-        String excludes = Sandbox.formatFilePatterns(fileSet.getExcludes());
-        String includes = Sandbox.formatFilePatterns(fileSet.getIncludes());
-        String msg = ((null == message || message.length() == 0) ? System.getProperty("message") : message);
-        List<ScmFile> addedFiles = siSandbox.addNonMembers(excludes, includes, msg);
-        if (siSandbox.getOverallAddSuccess()) {
-            return new AddScmResult("si add", addedFiles);
-        } else {
-            return new AddScmResult(addedFiles, new ScmResult("si add", "There was a problem adding files to the repository", "", false));
+        String excludes = Sandbox.formatFilePatterns( fileSet.getExcludes() );
+        String includes = Sandbox.formatFilePatterns( fileSet.getIncludes() );
+        String msg = ( ( null == message || message.length() == 0 ) ? System.getProperty( "message" ) : message );
+        List<ScmFile> addedFiles = siSandbox.addNonMembers( excludes, includes, msg );
+        if ( siSandbox.getOverallAddSuccess() )
+        {
+            return new AddScmResult( "si add", addedFiles );
+        }
+        else
+        {
+            return new AddScmResult( addedFiles,
+                                     new ScmResult( "si add", "There was a problem adding files to the repository", "",
+                                                    false ) );
         }
     }
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java Sat Aug 27 12:39:21 2011
@@ -37,41 +37,53 @@ import org.codehaus.plexus.util.cli.Comm
  *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
  * @version $Id: IntegrityBlameCommand.java 1.3 2011/08/22 13:06:15EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityBlameCommand extends AbstractBlameCommand {
+public class IntegrityBlameCommand
+    extends AbstractBlameCommand
+{
     /**
      * {@inheritDoc}
      */
     @Override
-    public BlameScmResult executeBlameCommand(ScmProviderRepository repository, ScmFileSet workingDirectory, String filename) throws ScmException {
-        getLogger().info("Attempting to display blame results for file: " + filename);
-        if (null == filename || filename.length() == 0) {
-            throw new ScmException("A single filename is required to execute the blame command!");
+    public BlameScmResult executeBlameCommand( ScmProviderRepository repository, ScmFileSet workingDirectory,
+                                               String filename )
+        throws ScmException
+    {
+        getLogger().info( "Attempting to display blame results for file: " + filename );
+        if ( null == filename || filename.length() == 0 )
+        {
+            throw new ScmException( "A single filename is required to execute the blame command!" );
         }
         BlameScmResult result;
         IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
         APISession api = iRepo.getAPISession();
         // Since the si annotate command is not completely API ready, we will use the CLI for this command
         Commandline shell = new Commandline();
-        shell.setWorkingDirectory(workingDirectory.getBasedir());
-        shell.setExecutable("si");
-        shell.createArg().setValue("annotate");
-        shell.createArg().setValue("--hostname=" + api.getHostName());
-        shell.createArg().setValue("--port=" + api.getPort());
-        shell.createArg().setValue("--user=" + api.getUserName());
-        shell.createArg().setValue("--fields=date,revision,author");
-        shell.createArg().setValue('"' + filename + '"');
-        IntegrityBlameConsumer shellConsumer = new IntegrityBlameConsumer(getLogger());
+        shell.setWorkingDirectory( workingDirectory.getBasedir() );
+        shell.setExecutable( "si" );
+        shell.createArg().setValue( "annotate" );
+        shell.createArg().setValue( "--hostname=" + api.getHostName() );
+        shell.createArg().setValue( "--port=" + api.getPort() );
+        shell.createArg().setValue( "--user=" + api.getUserName() );
+        shell.createArg().setValue( "--fields=date,revision,author" );
+        shell.createArg().setValue( '"' + filename + '"' );
+        IntegrityBlameConsumer shellConsumer = new IntegrityBlameConsumer( getLogger() );
 
-        try {
-            getLogger().debug("Executing: " + shell.getCommandline());
-            int exitCode = CommandLineUtils.executeCommandLine(shell, shellConsumer, new CommandLineUtils.StringStreamConsumer());
-            boolean success = (exitCode == 128 ? false : true);
-            ScmResult scmResult = new ScmResult(shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success);
-            return new BlameScmResult(shellConsumer.getBlameList(), scmResult);
-        } catch (CommandLineException cle) {
-            getLogger().error("Command Line Exception: " + cle.getMessage());
-            result = new BlameScmResult(shell.getCommandline().toString(), cle.getMessage(), "", false);
+        try
+        {
+            getLogger().debug( "Executing: " + shell.getCommandline() );
+            int exitCode = CommandLineUtils.executeCommandLine( shell, shellConsumer,
+                                                                new CommandLineUtils.StringStreamConsumer() );
+            boolean success = ( exitCode == 128 ? false : true );
+            ScmResult scmResult =
+                new ScmResult( shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success );
+            return new BlameScmResult( shellConsumer.getBlameList(), scmResult );
+        }
+        catch ( CommandLineException cle )
+        {
+            getLogger().error( "Command Line Exception: " + cle.getMessage() );
+            result = new BlameScmResult( shell.getCommandline().toString(), cle.getMessage(), "", false );
         }
 
         return result;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameConsumer.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameConsumer.java Sat Aug 27 12:39:21 2011
@@ -34,10 +34,15 @@ import java.util.List;
  *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
  * @version $Id: IntegrityBlameConsumer.java 1.2 2011/08/22 13:06:16EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityBlameConsumer implements StreamConsumer {
+public class IntegrityBlameConsumer
+    implements StreamConsumer
+{
     private ScmLogger logger;
+
     private List<BlameLine> blameList;
+
     private SimpleDateFormat dateFormat;
 
     /**
@@ -45,27 +50,36 @@ public class IntegrityBlameConsumer impl
      *
      * @param logger ScmLogger object
      */
-    public IntegrityBlameConsumer(ScmLogger logger) {
+    public IntegrityBlameConsumer( ScmLogger logger )
+    {
         this.logger = logger;
         this.blameList = new ArrayList<BlameLine>();
-        this.dateFormat = new SimpleDateFormat("MMM dd, yyyy z");
+        this.dateFormat = new SimpleDateFormat( "MMM dd, yyyy z" );
     }
 
     /**
      * {@inheritDoc}
      */
-    public void consumeLine(String line) {
+    public void consumeLine( String line )
+    {
         // Parse the annotate output which should return the three pieces of data
-        logger.debug(line);
-        if (null != line && line.trim().length() > 0) {
-            String[] tokens = StringUtils.split(line, "\t");
-            if (tokens.length != 3) {
-                logger.warn("Failed to parse line: " + line);
-            } else {
-                try {
-                    blameList.add(new BlameLine(dateFormat.parse(tokens[0]), tokens[1], tokens[2]));
-                } catch (ParseException e) {
-                    logger.error("Failed to date string: " + tokens[0]);
+        logger.debug( line );
+        if ( null != line && line.trim().length() > 0 )
+        {
+            String[] tokens = StringUtils.split( line, "\t" );
+            if ( tokens.length != 3 )
+            {
+                logger.warn( "Failed to parse line: " + line );
+            }
+            else
+            {
+                try
+                {
+                    blameList.add( new BlameLine( dateFormat.parse( tokens[0] ), tokens[1], tokens[2] ) );
+                }
+                catch ( ParseException e )
+                {
+                    logger.error( "Failed to date string: " + tokens[0] );
                 }
             }
         }
@@ -76,7 +90,8 @@ public class IntegrityBlameConsumer impl
      *
      * @return
      */
-    public List<BlameLine> getBlameList() {
+    public List<BlameLine> getBlameList()
+    {
         return blameList;
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/branch/IntegrityBranchCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/branch/IntegrityBranchCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/branch/IntegrityBranchCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/branch/IntegrityBranchCommand.java Sat Aug 27 12:39:21 2011
@@ -19,8 +19,8 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.util.ArrayList;
-
+import com.mks.api.response.APIException;
+import com.mks.api.response.Response;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -32,8 +32,7 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Project;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
-import com.mks.api.response.Response;
+import java.util.ArrayList;
 
 /**
  * MKS Integrity implementation for Maven's AbstractBranchCommand
@@ -41,45 +40,50 @@ import com.mks.api.response.Response;
  * prior to creating a Development Path (branch).  In the case of a build
  * configuration, the specified checkpoint revision is used to create
  * the Development Path
- * @version $Id: IntegrityBranchCommand.java 1.3 2011/08/22 13:06:17EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityBranchCommand.java 1.3 2011/08/22 13:06:17EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityBranchCommand extends AbstractBranchCommand 
+public class IntegrityBranchCommand
+    extends AbstractBranchCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public BranchScmResult executeBranchCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-												String branchName, String message) throws ScmException 
-	{
-		BranchScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-		Project siProject = iRepo.getProject();
-		getLogger().info("Attempting to branch project " + siProject.getProjectName() + " using branch name '" + branchName + "'");
-    	try
-    	{
-    		Project.validateTag(branchName);
-    		Response res = siProject.createDevPath(branchName);
-    		int exitCode = res.getExitCode();
-    		boolean success = (exitCode == 0 ? true : false);
-    		ScmResult scmResult = new ScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success);
-    		result = new BranchScmResult(new ArrayList<ScmFile>(), scmResult); 
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new BranchScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	catch(Exception e)
-    	{
-    		getLogger().error("Failed to checkpoint project! " + e.getMessage());
-    		result = new BranchScmResult("si createdevpath", e.getMessage(), "", false);    		
-    	}
-    	
-		return result;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public BranchScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                                 String branchName, String message )
+        throws ScmException
+    {
+        BranchScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        Project siProject = iRepo.getProject();
+        getLogger().info(
+            "Attempting to branch project " + siProject.getProjectName() + " using branch name '" + branchName + "'" );
+        try
+        {
+            Project.validateTag( branchName );
+            Response res = siProject.createDevPath( branchName );
+            int exitCode = res.getExitCode();
+            boolean success = ( exitCode == 0 ? true : false );
+            ScmResult scmResult = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
+            result = new BranchScmResult( new ArrayList<ScmFile>(), scmResult );
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new BranchScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+        catch ( Exception e )
+        {
+            getLogger().error( "Failed to checkpoint project! " + e.getMessage() );
+            result = new BranchScmResult( "si createdevpath", e.getMessage(), "", false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/changelog/IntegrityChangeLogCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/changelog/IntegrityChangeLogCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/changelog/IntegrityChangeLogCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/changelog/IntegrityChangeLogCommand.java Sat Aug 27 12:39:21 2011
@@ -19,8 +19,7 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.util.Date;
-
+import com.mks.api.response.APIException;
 import org.apache.maven.scm.ScmBranch;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
@@ -32,7 +31,7 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Sandbox;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
+import java.util.Date;
 
 /**
  * MKS Integrity implementation for Maven's AbstractChangeLogCommand
@@ -43,45 +42,52 @@ import com.mks.api.response.APIException
  * Change Package ID.  However, if no Change Package is found or Change
  * Packages are not in use, then all the changes are grouped in one big
  * Change Log Set
- * @version $Id: IntegrityChangeLogCommand.java 1.3 2011/08/22 13:06:19EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityChangeLogCommand.java 1.3 2011/08/22 13:06:19EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityChangeLogCommand extends AbstractChangeLogCommand 
+public class IntegrityChangeLogCommand
+    extends AbstractChangeLogCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public ChangeLogScmResult executeChangeLogCommand(ScmProviderRepository repository, 
-											ScmFileSet fileSet, Date startDate, Date endDate, 
-											ScmBranch branch, String datePattern) throws ScmException 
-	{
-		// First lets validate the date range provided
-		if( null == startDate || null == endDate )
-		{
-			throw new ScmException("Both 'startDate' and 'endDate' must be specified!");
-		}
-		if( startDate.after(endDate) )
-		{
-			throw new ScmException("'stateDate' is not allowed to occur after 'endDate'!");
-		}
-		getLogger().info("Attempting to obtain change log for date range: '" + Sandbox.RLOG_DATEFORMAT.format(startDate) 
-						+ "' to '" + Sandbox.RLOG_DATEFORMAT.format(endDate) + "'");
-		ChangeLogScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-    	try
-    	{
-    		result = new ChangeLogScmResult(iRepo.getSandbox().getChangeLog(startDate, endDate), new ScmResult("si rlog", "", "", true)); 
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new ChangeLogScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                                       Date startDate, Date endDate, ScmBranch branch,
+                                                       String datePattern )
+        throws ScmException
+    {
+        // First lets validate the date range provided
+        if ( null == startDate || null == endDate )
+        {
+            throw new ScmException( "Both 'startDate' and 'endDate' must be specified!" );
+        }
+        if ( startDate.after( endDate ) )
+        {
+            throw new ScmException( "'stateDate' is not allowed to occur after 'endDate'!" );
+        }
+        getLogger().info(
+            "Attempting to obtain change log for date range: '" + Sandbox.RLOG_DATEFORMAT.format( startDate ) + "' to '"
+                + Sandbox.RLOG_DATEFORMAT.format( endDate ) + "'" );
+        ChangeLogScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        try
+        {
+            result = new ChangeLogScmResult( iRepo.getSandbox().getChangeLog( startDate, endDate ),
+                                             new ScmResult( "si rlog", "", "", true ) );
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result =
+                new ChangeLogScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkin/IntegrityCheckInCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkin/IntegrityCheckInCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkin/IntegrityCheckInCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkin/IntegrityCheckInCommand.java Sat Aug 27 12:39:21 2011
@@ -1,4 +1,4 @@
-	package org.apache.maven.scm.provider.integrity.command.checkin;
+package org.apache.maven.scm.provider.integrity.command.checkin;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,8 +19,6 @@
  * under the License.
  */
 
-import java.util.List;
-
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -32,32 +30,40 @@ import org.apache.maven.scm.provider.Scm
 import org.apache.maven.scm.provider.integrity.Sandbox;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
+import java.util.List;
+
 /**
  * MKS Integrity implementation for Maven's AbstractCheckInCommand
- * <br>The check-in command will also drop any files that are missing from the working directory 
- * @version $Id: IntegrityCheckInCommand.java 1.3 2011/08/22 13:06:20EDT Cletus D'Souza (dsouza) Exp  $
+ * <br>The check-in command will also drop any files that are missing from the working directory
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityCheckInCommand.java 1.3 2011/08/22 13:06:20EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityCheckInCommand extends AbstractCheckInCommand 
+public class IntegrityCheckInCommand
+    extends AbstractCheckInCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */	
-	@Override
-	public CheckInScmResult executeCheckInCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-												String message, ScmVersion scmVersion) throws ScmException 
-	{
-		getLogger().info("Attempting to check-in updates from sandbox " + fileSet.getBasedir().getAbsolutePath());
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
-		Sandbox siSandbox = iRepo.getSandbox();
-		List<ScmFile> changedFiles = siSandbox.checkInUpdates(message);
-		if( siSandbox.getOverallCheckInSuccess() )
-		{
-			return new CheckInScmResult("si ci/drop", changedFiles);
-		}
-		else
-		{
-			return new CheckInScmResult(changedFiles, new ScmResult("si ci/drop", "There was a problem updating the repository", "", false)); 
-		}		
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public CheckInScmResult executeCheckInCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message,
+                                                   ScmVersion scmVersion )
+        throws ScmException
+    {
+        getLogger().info( "Attempting to check-in updates from sandbox " + fileSet.getBasedir().getAbsolutePath() );
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        Sandbox siSandbox = iRepo.getSandbox();
+        List<ScmFile> changedFiles = siSandbox.checkInUpdates( message );
+        if ( siSandbox.getOverallCheckInSuccess() )
+        {
+            return new CheckInScmResult( "si ci/drop", changedFiles );
+        }
+        else
+        {
+            return new CheckInScmResult( changedFiles,
+                                         new ScmResult( "si ci/drop", "There was a problem updating the repository", "",
+                                                        false ) );
+        }
+    }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java Sat Aug 27 12:39:21 2011
@@ -19,6 +19,12 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
+import com.mks.api.response.APIException;
+import com.mks.api.response.Response;
+import com.mks.api.response.Result;
+import com.mks.api.response.WorkItem;
+import com.mks.api.response.WorkItemIterator;
+import com.mks.api.si.SIModelTypeName;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmVersion;
@@ -29,88 +35,86 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Sandbox;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
-import com.mks.api.response.Response;
-import com.mks.api.response.Result;
-import com.mks.api.response.WorkItem;
-import com.mks.api.response.WorkItemIterator;
-import com.mks.api.si.SIModelTypeName;
-
 /**
  * MKS Integrity implementation for Maven's AbstractCheckOutCommand
  * <br>The Checkout command will create a fresh sandbox in the checkoutDirectory
  * <br>Since, Maven deletes the prior checkout folder, this command will check
  * for a prior sandbox in the checkout directory and if a sandbox was found,
- * then the command will resynchronize the sandbox. 
- * @version $Id: IntegrityCheckOutCommand.java 1.3 2011/08/22 13:06:21EDT Cletus D'Souza (dsouza) Exp  $
+ * then the command will resynchronize the sandbox.
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityCheckOutCommand.java 1.3 2011/08/22 13:06:21EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityCheckOutCommand extends AbstractCheckOutCommand 
+public class IntegrityCheckOutCommand
+    extends AbstractCheckOutCommand
 {
-	/**
-	 * Overridden function that performs a checkout (resynchronize) operation against an MKS Source Project
-	 * This function ignores the scmVerion and recursive arguments passed into this function as while there is
-	 * a suitable equivalent to checkout/resynchronize by label/revision, it doesn't make sense for the way
-	 * Maven seems to want to execute this command.  Hence we will create/resynchronize a sandbox, which will
-	 * be recursive in nature.  If the user chooses to checkout a specific versioned configuration (checkpoint),
-	 * then that information will be contained in the Configuration Path obtained from the IntegrityScmProviderRepository
-	 */
-	@Override
-	public CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-													ScmVersion scmVersion, boolean recursive) throws ScmException 
-	{
-		CheckOutScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-    	try
-    	{
-    		getLogger().info("Attempting to checkout source for project " + iRepo.getProject().getConfigurationPath());
-    		String checkoutDir = System.getProperty("checkoutDirectory");
-    		// Override the sandbox definition, if a checkout directory is specified for this command
-    		Sandbox siSandbox;
-    		if( null != checkoutDir && checkoutDir.length() > 0 )
-    		{
-    			siSandbox = new Sandbox(iRepo.getAPISession(), iRepo.getProject(), checkoutDir);
-    			iRepo.setSandbox(siSandbox);
-    		}
-    		else
-    		{
-    			siSandbox = iRepo.getSandbox();
-    		}
-    		getLogger().info("Sandbox location is " + siSandbox.getSandboxDir());
-    		// Now attempt to create the sandbox, if it doesn't already exist
-    		if( siSandbox.create() )
-    		{
-    			// Resynchronize the new or previously created sandbox
-    			Response res = siSandbox.resync();
-    			// Lets output what we got from running this command
-    			WorkItemIterator wit = res.getWorkItems();
-    			while(wit.hasNext())
-    			{
-    				WorkItem wi = wit.next();
-    				if( wi.getModelType().equals(SIModelTypeName.MEMBER) )
-    				{
-    					Result message = wi.getResult();
-    					getLogger().debug(wi.getDisplayId() + " " + (null != message ? message.getMessage() : ""));
-    				}
-    			}
-        		int exitCode = res.getExitCode();
-        		boolean success = (exitCode == 0 ? true : false);
-        		result = new CheckOutScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success); 
-    		}
-    		else
-    		{
-        		result = new CheckOutScmResult("si createsandbox", "Failed to create sandbox!", "", false);
-    		}
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new CheckOutScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * Overridden function that performs a checkout (resynchronize) operation against an MKS Source Project
+     * This function ignores the scmVerion and recursive arguments passed into this function as while there is
+     * a suitable equivalent to checkout/resynchronize by label/revision, it doesn't make sense for the way
+     * Maven seems to want to execute this command.  Hence we will create/resynchronize a sandbox, which will
+     * be recursive in nature.  If the user chooses to checkout a specific versioned configuration (checkpoint),
+     * then that information will be contained in the Configuration Path obtained from the IntegrityScmProviderRepository
+     */
+    @Override
+    public CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                                     ScmVersion scmVersion, boolean recursive )
+        throws ScmException
+    {
+        CheckOutScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        try
+        {
+            getLogger().info(
+                "Attempting to checkout source for project " + iRepo.getProject().getConfigurationPath() );
+            String checkoutDir = System.getProperty( "checkoutDirectory" );
+            // Override the sandbox definition, if a checkout directory is specified for this command
+            Sandbox siSandbox;
+            if ( null != checkoutDir && checkoutDir.length() > 0 )
+            {
+                siSandbox = new Sandbox( iRepo.getAPISession(), iRepo.getProject(), checkoutDir );
+                iRepo.setSandbox( siSandbox );
+            }
+            else
+            {
+                siSandbox = iRepo.getSandbox();
+            }
+            getLogger().info( "Sandbox location is " + siSandbox.getSandboxDir() );
+            // Now attempt to create the sandbox, if it doesn't already exist
+            if ( siSandbox.create() )
+            {
+                // Resynchronize the new or previously created sandbox
+                Response res = siSandbox.resync();
+                // Lets output what we got from running this command
+                WorkItemIterator wit = res.getWorkItems();
+                while ( wit.hasNext() )
+                {
+                    WorkItem wi = wit.next();
+                    if ( wi.getModelType().equals( SIModelTypeName.MEMBER ) )
+                    {
+                        Result message = wi.getResult();
+                        getLogger().debug( wi.getDisplayId() + " " + ( null != message ? message.getMessage() : "" ) );
+                    }
+                }
+                int exitCode = res.getExitCode();
+                boolean success = ( exitCode == 0 ? true : false );
+                result = new CheckOutScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
+            }
+            else
+            {
+                result = new CheckOutScmResult( "si createsandbox", "Failed to create sandbox!", "", false );
+            }
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new CheckOutScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java Sat Aug 27 12:39:21 2011
@@ -19,9 +19,6 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.HashMap;
-
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -32,66 +29,75 @@ import org.apache.maven.scm.command.diff
 import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.apache.maven.scm.provider.integrity.APISession;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
+import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
-import org.codehaus.plexus.util.cli.CommandLineException;
+
+import java.util.ArrayList;
+import java.util.HashMap;
 
 /**
  * MKS Integrity implementation for Maven's AbstractDiffCommand
  * <br>Since MKS Integrity doesn't have a notion of arbitrarily differencing
- * by a revision across the sandbox, this command will difference the 
+ * by a revision across the sandbox, this command will difference the
  * current Sandbox working file against the server version.
- * @version $Id: IntegrityDiffCommand.java 1.4 2011/08/24 10:29:08EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityDiffCommand.java 1.4 2011/08/24 10:29:08EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityDiffCommand extends AbstractDiffCommand 
+public class IntegrityDiffCommand
+    extends AbstractDiffCommand
 {
-	/**
-	 * Since we can't arbitrarily apply the same start and end revisions to all files in the sandbox,
-	 * this command will be adapted to show differences between the local version and the repository
-	 */
-	@Override
-	public DiffScmResult executeDiffCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-											ScmVersion startRevision, ScmVersion endRevision) throws ScmException 
-	{
-		DiffScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-		APISession api = iRepo.getAPISession();
-		getLogger().info("Showing differences bettween local files in " + fileSet.getBasedir().getAbsolutePath() +
-						" and server project " + iRepo.getConfigruationPath() );
-
-		// Since the si diff command is not completely API ready, we will use the CLI for this command
-		Commandline shell = new Commandline();
-		shell.setWorkingDirectory(fileSet.getBasedir());
-		shell.setExecutable("si");
-		shell.createArg().setValue("diff");
-		shell.createArg().setValue("--hostname=" + api.getHostName());
-		shell.createArg().setValue("--port=" + api.getPort());
-		shell.createArg().setValue("--user=" + api.getUserName());
-		shell.createArg().setValue("-R");
-		shell.createArg().setValue("--filter=changed:all");
-		shell.createArg().setValue("--filter=format:text");
-		IntegrityDiffConsumer shellConsumer = new IntegrityDiffConsumer(getLogger());
-
-    	try
-    	{
-    		getLogger().debug("Executing: " + shell.getCommandline());
-    		int exitCode = CommandLineUtils.executeCommandLine(shell, shellConsumer, new CommandLineUtils.StringStreamConsumer());
-    		boolean success = (exitCode == 128 ? false : true);
-    		ScmResult scmResult = new ScmResult(shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success);
-    		// Since we can't really parse the differences output, we'll just have to go by the command output
-    		// Returning a DiffScmResult(List changedFiles, Map differences, String patch, ScmResult result) to avoid an NPE
-    		// in org.codehaus.plexus.util.FileUtils.fileWrite(FileUtils.java:426)
-    		return new DiffScmResult(new ArrayList<ScmFile>(), new HashMap<String,CharSequence>(), "", scmResult); 
-
-    	}
-    	catch(CommandLineException cle)
-    	{
-    		getLogger().error("Command Line Exception: " + cle.getMessage());
-    		result = new DiffScmResult(shell.getCommandline().toString(), cle.getMessage(), "", false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * Since we can't arbitrarily apply the same start and end revisions to all files in the sandbox,
+     * this command will be adapted to show differences between the local version and the repository
+     */
+    @Override
+    public DiffScmResult executeDiffCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                             ScmVersion startRevision, ScmVersion endRevision )
+        throws ScmException
+    {
+        DiffScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        APISession api = iRepo.getAPISession();
+        getLogger().info( "Showing differences bettween local files in " + fileSet.getBasedir().getAbsolutePath()
+                              + " and server project " + iRepo.getConfigruationPath() );
+
+        // Since the si diff command is not completely API ready, we will use the CLI for this command
+        Commandline shell = new Commandline();
+        shell.setWorkingDirectory( fileSet.getBasedir() );
+        shell.setExecutable( "si" );
+        shell.createArg().setValue( "diff" );
+        shell.createArg().setValue( "--hostname=" + api.getHostName() );
+        shell.createArg().setValue( "--port=" + api.getPort() );
+        shell.createArg().setValue( "--user=" + api.getUserName() );
+        shell.createArg().setValue( "-R" );
+        shell.createArg().setValue( "--filter=changed:all" );
+        shell.createArg().setValue( "--filter=format:text" );
+        IntegrityDiffConsumer shellConsumer = new IntegrityDiffConsumer( getLogger() );
+
+        try
+        {
+            getLogger().debug( "Executing: " + shell.getCommandline() );
+            int exitCode = CommandLineUtils.executeCommandLine( shell, shellConsumer,
+                                                                new CommandLineUtils.StringStreamConsumer() );
+            boolean success = ( exitCode == 128 ? false : true );
+            ScmResult scmResult =
+                new ScmResult( shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success );
+            // Since we can't really parse the differences output, we'll just have to go by the command output
+            // Returning a DiffScmResult(List changedFiles, Map differences, String patch, ScmResult result) to avoid an NPE
+            // in org.codehaus.plexus.util.FileUtils.fileWrite(FileUtils.java:426)
+            return new DiffScmResult( new ArrayList<ScmFile>(), new HashMap<String, CharSequence>(), "", scmResult );
+
+        }
+        catch ( CommandLineException cle )
+        {
+            getLogger().error( "Command Line Exception: " + cle.getMessage() );
+            result = new DiffScmResult( shell.getCommandline().toString(), cle.getMessage(), "", false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/edit/IntegrityEditCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/edit/IntegrityEditCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/edit/IntegrityEditCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/edit/IntegrityEditCommand.java Sat Aug 27 12:39:21 2011
@@ -19,6 +19,8 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
+import com.mks.api.response.APIException;
+import com.mks.api.response.Response;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.command.edit.AbstractEditCommand;
@@ -28,44 +30,45 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Sandbox;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
-import com.mks.api.response.Response;
-
 /**
  * MKS Integrity implementation for Maven's AbstractEditCommand
  * <br>Since it does not make sense to lock all files in the Sandbox,
  * this command will make all of the working files writable in the Sandbox
- * @version $Id: IntegrityEditCommand.java 1.3 2011/08/22 13:06:25EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityEditCommand.java 1.3 2011/08/22 13:06:25EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityEditCommand extends AbstractEditCommand 
+public class IntegrityEditCommand
+    extends AbstractEditCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public EditScmResult executeEditCommand(ScmProviderRepository repository, ScmFileSet fileSet) throws ScmException 
-	{
-		getLogger().info("Attempting make files writeable in Sandbox " + fileSet.getBasedir().getAbsolutePath());
-		EditScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-    	try
-    	{
-    		Sandbox siSandbox = iRepo.getSandbox();
-    		Response res = siSandbox.makeWriteable();
-    		int exitCode = res.getExitCode();
-    		boolean success = (exitCode == 0 ? true : false);
-    		result = new EditScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success); 
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new EditScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-		
-		return result;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public EditScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet )
+        throws ScmException
+    {
+        getLogger().info( "Attempting make files writeable in Sandbox " + fileSet.getBasedir().getAbsolutePath() );
+        EditScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        try
+        {
+            Sandbox siSandbox = iRepo.getSandbox();
+            Response res = siSandbox.makeWriteable();
+            int exitCode = res.getExitCode();
+            boolean success = ( exitCode == 0 ? true : false );
+            result = new EditScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new EditScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/export/IntegrityExportCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/export/IntegrityExportCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/export/IntegrityExportCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/export/IntegrityExportCommand.java Sat Aug 27 12:39:21 2011
@@ -19,10 +19,7 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
+import com.mks.api.response.APIException;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -35,7 +32,9 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Member;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * MKS Integrity implementation for Maven's AbstractExportCommand
@@ -44,71 +43,78 @@ import com.mks.api.response.APIException
  * <br>Hence, this command does not create a Sandbox, instead the entire project contents
  * are exported to the exportDirectory using the 'si projectco' command.
  * <br>This gives the user the option of exporting a fresh copy of the repository void of
- * any project.pj files 
- * @version $Id: IntegrityExportCommand.java 1.3 2011/08/22 13:06:26EDT Cletus D'Souza (dsouza) Exp  $
+ * any project.pj files
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityExportCommand.java 1.3 2011/08/22 13:06:26EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityExportCommand extends AbstractExportCommand 
+public class IntegrityExportCommand
+    extends AbstractExportCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public ExportScmResult executeExportCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-									ScmVersion scmVersion, String outputDirectory)  throws ScmException 
-	{
-		// First lets figure out where we need to export files to...
-		String exportDir = outputDirectory;
-		exportDir = ((null != exportDir && exportDir.length() > 0) ? exportDir : fileSet.getBasedir().getAbsolutePath());
-		// Let the user know where we're going to be exporting the files...
-		getLogger().info("Attempting to export files to " + exportDir);
-		ExportScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-    	try
-    	{
-    		// Lets set our overall export success flag
-    		boolean exportSuccess = true;
-			// Perform a fresh checkout of each file in the member list...
-			List<Member> projectMembers = iRepo.getProject().listFiles(exportDir);
-			// Initialize the list of files we actually exported...
-			List<ScmFile> scmFileList = new ArrayList<ScmFile>();
-			for( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
-			{
-				Member siMember = it.next();
-				try
-				{
-					getLogger().info("Attempting to export file: " + siMember.getTargetFilePath() + " at revision " + siMember.getRevision());					
-					siMember.checkout(iRepo.getAPISession());
-					scmFileList.add(new ScmFile(siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN));
-				}
-				catch(APIException ae)
-				{
-					exportSuccess = false;
-		    		ExceptionHandler eh = new ExceptionHandler(ae);
-		    		getLogger().error("MKS API Exception: " + eh.getMessage());
-		    		getLogger().debug(eh.getCommand() + " exited with return code " + eh.getExitCode());
-				}
-			}
-			// Lets advice the user that we've checked out all the members
-			getLogger().info("Exported " + scmFileList.size() + " files out of a total of " + projectMembers.size() + " files!");   
-			if( exportSuccess )
-			{
-				result = new ExportScmResult("si co", scmFileList);
-			}
-			else
-			{
-	    		result = new ExportScmResult("si co", "Failed to export all files!", "", exportSuccess);
-			}
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().debug(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new ExportScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ExportScmResult executeExportCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                                 ScmVersion scmVersion, String outputDirectory )
+        throws ScmException
+    {
+        // First lets figure out where we need to export files to...
+        String exportDir = outputDirectory;
+        exportDir =
+            ( ( null != exportDir && exportDir.length() > 0 ) ? exportDir : fileSet.getBasedir().getAbsolutePath() );
+        // Let the user know where we're going to be exporting the files...
+        getLogger().info( "Attempting to export files to " + exportDir );
+        ExportScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        try
+        {
+            // Lets set our overall export success flag
+            boolean exportSuccess = true;
+            // Perform a fresh checkout of each file in the member list...
+            List<Member> projectMembers = iRepo.getProject().listFiles( exportDir );
+            // Initialize the list of files we actually exported...
+            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
+            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
+            {
+                Member siMember = it.next();
+                try
+                {
+                    getLogger().info( "Attempting to export file: " + siMember.getTargetFilePath() + " at revision "
+                                          + siMember.getRevision() );
+                    siMember.checkout( iRepo.getAPISession() );
+                    scmFileList.add( new ScmFile( siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN ) );
+                }
+                catch ( APIException ae )
+                {
+                    exportSuccess = false;
+                    ExceptionHandler eh = new ExceptionHandler( ae );
+                    getLogger().error( "MKS API Exception: " + eh.getMessage() );
+                    getLogger().debug( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+                }
+            }
+            // Lets advice the user that we've checked out all the members
+            getLogger().info(
+                "Exported " + scmFileList.size() + " files out of a total of " + projectMembers.size() + " files!" );
+            if ( exportSuccess )
+            {
+                result = new ExportScmResult( "si co", scmFileList );
+            }
+            else
+            {
+                result = new ExportScmResult( "si co", "Failed to export all files!", "", exportSuccess );
+            }
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().debug( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new ExportScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java Sat Aug 27 12:39:21 2011
@@ -19,8 +19,6 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.io.File;
-
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
 import org.apache.maven.scm.ScmException;
@@ -34,6 +32,8 @@ import org.codehaus.plexus.util.cli.Comm
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
+import java.io.File;
+
 /**
  * MKS Integrity implementation for Maven's AbstractFileInfoCommand
  * <br>This command will run a 'si memberinfo' command.  Even though this
@@ -41,61 +41,69 @@ import org.codehaus.plexus.util.cli.Comm
  * its not clear what exactly this command is supposed to be returning
  * to the Maven SCM framework.  Hence the CLI output is returned to the
  * console verbatim
- * @version $Id: IntegrityFileInfoCommand.java 1.3 2011/08/22 13:06:28EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityFileInfoCommand.java 1.3 2011/08/22 13:06:28EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityFileInfoCommand extends AbstractFileInfoCommand 
+public class IntegrityFileInfoCommand
+    extends AbstractFileInfoCommand
 {
-	/**
-	 * Even though this command is supported via the MKS JAVA API, since at this time we really don't 
-	 * know what the SCM plugin is looking to get in return for this command, we're simply going to 
-	 * run this command via the CLI and return the output verbatim
-	 */
-	@Override
-	public ScmResult executeFileInfoCommand(ScmProviderRepository repository, File workingDirectory, String filename) throws ScmException 
-	{
-		getLogger().info("Attempting to display scm file information for file: " + filename);		
-		if( null == filename || filename.length() == 0 )
-		{
-			throw new ScmException("A single filename is required to execute the fileinfo command!");
-		}
-		ScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-		APISession api = iRepo.getAPISession();
-		Commandline shell = new Commandline();
-		shell.setWorkingDirectory(workingDirectory);
-		shell.setExecutable("si");
-		shell.createArg().setValue("memberinfo");
-		shell.createArg().setValue("--hostname=" + api.getHostName());
-		shell.createArg().setValue("--port=" + api.getPort());
-		shell.createArg().setValue("--user=" + api.getUserName());
-		shell.createArg().setValue('"' + filename + '"');
-		IntegrityFileInfoConsumer shellConsumer = new IntegrityFileInfoConsumer(getLogger());
-
-    	try
-    	{
-    		getLogger().debug("Executing: " + shell.getCommandline());
-    		int exitCode = CommandLineUtils.executeCommandLine(shell, shellConsumer, new CommandLineUtils.StringStreamConsumer());
-    		boolean success = (exitCode == 128 ? false : true);
-    		result = new ScmResult(shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success);
-
-    	}
-    	catch(CommandLineException cle)
-    	{
-    		getLogger().error("Command Line Exception: " + cle.getMessage());
-    		result = new ScmResult(shell.getCommandline().toString(), cle.getMessage(), "", false);
-    	}
-    	
-		return result;
-	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	protected ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException 
-	{
-		return executeFileInfoCommand(repository, fileSet.getBasedir(), parameters.getString(CommandParameter.FILE));
-	}
+    /**
+     * Even though this command is supported via the MKS JAVA API, since at this time we really don't
+     * know what the SCM plugin is looking to get in return for this command, we're simply going to
+     * run this command via the CLI and return the output verbatim
+     */
+    @Override
+    public ScmResult executeFileInfoCommand( ScmProviderRepository repository, File workingDirectory, String filename )
+        throws ScmException
+    {
+        getLogger().info( "Attempting to display scm file information for file: " + filename );
+        if ( null == filename || filename.length() == 0 )
+        {
+            throw new ScmException( "A single filename is required to execute the fileinfo command!" );
+        }
+        ScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        APISession api = iRepo.getAPISession();
+        Commandline shell = new Commandline();
+        shell.setWorkingDirectory( workingDirectory );
+        shell.setExecutable( "si" );
+        shell.createArg().setValue( "memberinfo" );
+        shell.createArg().setValue( "--hostname=" + api.getHostName() );
+        shell.createArg().setValue( "--port=" + api.getPort() );
+        shell.createArg().setValue( "--user=" + api.getUserName() );
+        shell.createArg().setValue( '"' + filename + '"' );
+        IntegrityFileInfoConsumer shellConsumer = new IntegrityFileInfoConsumer( getLogger() );
+
+        try
+        {
+            getLogger().debug( "Executing: " + shell.getCommandline() );
+            int exitCode = CommandLineUtils.executeCommandLine( shell, shellConsumer,
+                                                                new CommandLineUtils.StringStreamConsumer() );
+            boolean success = ( exitCode == 128 ? false : true );
+            result = new ScmResult( shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success );
+
+        }
+        catch ( CommandLineException cle )
+        {
+            getLogger().error( "Command Line Exception: " + cle.getMessage() );
+            result = new ScmResult( shell.getCommandline().toString(), cle.getMessage(), "", false );
+        }
+
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                        CommandParameters parameters )
+        throws ScmException
+    {
+        return executeFileInfoCommand( repository, fileSet.getBasedir(),
+                                       parameters.getString( CommandParameter.FILE ) );
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/list/IntegrityListCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/list/IntegrityListCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/list/IntegrityListCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/list/IntegrityListCommand.java Sat Aug 27 12:39:21 2011
@@ -19,10 +19,7 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
+import com.mks.api.response.APIException;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -36,49 +33,55 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Member;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * MKS Integrity implementation for Maven's AbstractListCommand
  * <br>This command will a 'si viewproject' command listing all the files in the project
- * @version $Id: IntegrityListCommand.java 1.4 2011/08/22 13:06:30EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityListCommand.java 1.4 2011/08/22 13:06:30EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityListCommand extends AbstractListCommand 
+public class IntegrityListCommand
+    extends AbstractListCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */	
-	@Override
-	public ListScmResult executeListCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-											boolean recursive, ScmVersion scmVersion) throws ScmException 
-	{
-		ListScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
-		getLogger().info("Listing all files in project " + iRepo.getConfigruationPath() );
-    	try
-    	{
-			// Get a listing for all the members in the project...
-			List<Member> projectMembers = iRepo.getProject().listFiles(fileSet.getBasedir().getAbsolutePath());
-			// Initialize the list of ScmFile objects for the ListScmResult
-			List<ScmFile> scmFileList = new ArrayList<ScmFile>();
-			for( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
-			{
-				Member siMember = it.next();
-				scmFileList.add(new ScmFile(siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN));
-			}
-			result = new ListScmResult(scmFileList, new ScmResult("si viewproject", "", "", true)); 
-
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().debug(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new ListScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive,
+                                             ScmVersion scmVersion )
+        throws ScmException
+    {
+        ListScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        getLogger().info( "Listing all files in project " + iRepo.getConfigruationPath() );
+        try
+        {
+            // Get a listing for all the members in the project...
+            List<Member> projectMembers = iRepo.getProject().listFiles( fileSet.getBasedir().getAbsolutePath() );
+            // Initialize the list of ScmFile objects for the ListScmResult
+            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
+            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
+            {
+                Member siMember = it.next();
+                scmFileList.add( new ScmFile( siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN ) );
+            }
+            result = new ListScmResult( scmFileList, new ScmResult( "si viewproject", "", "", true ) );
+
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().debug( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new ListScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/lock/IntegrityLockCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/lock/IntegrityLockCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/lock/IntegrityLockCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/lock/IntegrityLockCommand.java Sat Aug 27 12:39:21 2011
@@ -19,8 +19,8 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.io.File;
-
+import com.mks.api.response.APIException;
+import com.mks.api.response.Response;
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
 import org.apache.maven.scm.ScmException;
@@ -32,59 +32,64 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Sandbox;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
-import com.mks.api.response.Response;
+import java.io.File;
 
 /**
  * MKS Integrity implementation of Maven's AbstractLockCommand
  * <br>This command will execute a 'si lock' on the specified member,
  * which assumes the user has a valid Sandbox to work with.
- * @version $Id: IntegrityLockCommand.java 1.3 2011/08/22 13:06:31EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityLockCommand.java 1.3 2011/08/22 13:06:31EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityLockCommand extends AbstractLockCommand 
+public class IntegrityLockCommand
+    extends AbstractLockCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */	
-	@Override
-	public ScmResult executeLockCommand(ScmProviderRepository repository, File workingDirectory, String filename) throws ScmException 
-	{
-		getLogger().info("Attempting to lock file: " + filename);		
-		if( null == filename || filename.length() == 0 )
-		{
-			throw new ScmException("A single filename is required to execute the lock command!");
-		}
-
-		ScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-    	try
-    	{
-    		Sandbox siSandbox = iRepo.getSandbox();
-    		File memberFile = new File(workingDirectory.getAbsoluteFile() + File.separator + filename); 
-    		Response res = siSandbox.lock(memberFile, filename);
-    		int exitCode = res.getExitCode();
-    		boolean success = (exitCode == 0 ? true : false);
-    		result = new ScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success); 
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new ScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */	
-	@Override
-	protected ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
-	{
-		return executeLockCommand(repository, fileSet.getBasedir(), parameters.getString(CommandParameter.FILE));
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ScmResult executeLockCommand( ScmProviderRepository repository, File workingDirectory, String filename )
+        throws ScmException
+    {
+        getLogger().info( "Attempting to lock file: " + filename );
+        if ( null == filename || filename.length() == 0 )
+        {
+            throw new ScmException( "A single filename is required to execute the lock command!" );
+        }
+
+        ScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        try
+        {
+            Sandbox siSandbox = iRepo.getSandbox();
+            File memberFile = new File( workingDirectory.getAbsoluteFile() + File.separator + filename );
+            Response res = siSandbox.lock( memberFile, filename );
+            int exitCode = res.getExitCode();
+            boolean success = ( exitCode == 0 ? true : false );
+            result = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new ScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                        CommandParameters parameters )
+        throws ScmException
+    {
+        return executeLockCommand( repository, fileSet.getBasedir(), parameters.getString( CommandParameter.FILE ) );
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/login/IntegrityLoginCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/login/IntegrityLoginCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/login/IntegrityLoginCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/login/IntegrityLoginCommand.java Sat Aug 27 12:39:21 2011
@@ -19,6 +19,8 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
+import com.mks.api.response.APIException;
+import com.mks.api.response.Response;
 import org.apache.maven.scm.CommandParameters;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
@@ -31,9 +33,6 @@ import org.apache.maven.scm.provider.int
 import org.apache.maven.scm.provider.integrity.Sandbox;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
-import com.mks.api.response.Response;
-
 /**
  * MKS Integrity implementation of Maven's AbstractLoginCommand
  * <br>This command will execute a 'si login' followed by a 'si viewproject'
@@ -41,44 +40,49 @@ import com.mks.api.response.Response;
  * <br>The login command uses a Local Client API Integration Point and hence the
  * <br>MKS Integrity Client is required to be installed on the local client as a
  * pre-requisite.
- * @version $Id: IntegrityLoginCommand.java 1.2 2011/08/22 13:06:33EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityLoginCommand.java 1.2 2011/08/22 13:06:33EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityLoginCommand extends AbstractLoginCommand 
+public class IntegrityLoginCommand
+    extends AbstractLoginCommand
 {
-	/**
-	 * {@inheritDoc}
-	 */	
-	@Override
-	public LoginScmResult executeLoginCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params) throws ScmException 
-	{
-		getLogger().info("Attempting to connect with the MKS Integrity Server");
-		LoginScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-		APISession api = iRepo.getAPISession();
-    	try
-    	{
-    		// First we will establish a connection to the MKS Integrity Server
-    		Response res = api.connect(iRepo.getHost(), iRepo.getPort(), iRepo.getUser(), iRepo.getPassword());
-    		int exitCode = res.getExitCode();
-    		boolean success = (exitCode == 0 ? true : false);
-    		result = new LoginScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success);
-    		
-    		// Next we will prepare the Project and Sandbox for the other commands
-    		Project siProject = new Project(api, iRepo.getConfigruationPath());
-    		Sandbox siSandbox = new Sandbox(api, siProject, fileSet.getBasedir().getAbsolutePath());
-    		iRepo.setProject(siProject);
-    		iRepo.setSandbox(siSandbox);
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new LoginScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public LoginScmResult executeLoginCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                               CommandParameters params )
+        throws ScmException
+    {
+        getLogger().info( "Attempting to connect with the MKS Integrity Server" );
+        LoginScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        APISession api = iRepo.getAPISession();
+        try
+        {
+            // First we will establish a connection to the MKS Integrity Server
+            Response res = api.connect( iRepo.getHost(), iRepo.getPort(), iRepo.getUser(), iRepo.getPassword() );
+            int exitCode = res.getExitCode();
+            boolean success = ( exitCode == 0 ? true : false );
+            result = new LoginScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
+
+            // Next we will prepare the Project and Sandbox for the other commands
+            Project siProject = new Project( api, iRepo.getConfigruationPath() );
+            Sandbox siSandbox = new Sandbox( api, siProject, fileSet.getBasedir().getAbsolutePath() );
+            iRepo.setProject( siProject );
+            iRepo.setSandbox( siSandbox );
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new LoginScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/mkdir/IntegrityMkdirCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/mkdir/IntegrityMkdirCommand.java?rev=1162334&r1=1162333&r2=1162334&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/mkdir/IntegrityMkdirCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/mkdir/IntegrityMkdirCommand.java Sat Aug 27 12:39:21 2011
@@ -19,11 +19,8 @@ package org.apache.maven.scm.provider.in
  * under the License.
  */
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
+import com.mks.api.response.APIException;
+import com.mks.api.response.Response;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -35,8 +32,10 @@ import org.apache.maven.scm.provider.Scm
 import org.apache.maven.scm.provider.integrity.ExceptionHandler;
 import org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository;
 
-import com.mks.api.response.APIException;
-import com.mks.api.response.Response;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * MKS Integrity implementation of Maven's AbstractMkdirCommand
@@ -44,53 +43,59 @@ import com.mks.api.response.Response;
  * represented in the fileSet.getFileList().iterator().next() entry.
  * <br>A single subproject is created required for every directory encountered
  * in the relative path.
- * @version $Id: IntegrityMkdirCommand.java 1.3 2011/08/22 13:06:34EDT Cletus D'Souza (dsouza) Exp  $
+ *
  * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
+ * @version $Id: IntegrityMkdirCommand.java 1.3 2011/08/22 13:06:34EDT Cletus D'Souza (dsouza) Exp  $
+ * @since 1.6
  */
-public class IntegrityMkdirCommand extends AbstractMkdirCommand 
+public class IntegrityMkdirCommand
+    extends AbstractMkdirCommand
 {
-	/**
-	 * Creates a subproject in the Integrity repository.  
-	 * <br>However, since the subproject automatically creates a folder in 
-	 * the local sandbox, the createInLocal argument will be ignored
-	 */
-	@Override
-	public MkdirScmResult executeMkdirCommand(ScmProviderRepository repository, ScmFileSet fileSet, 
-												String message, boolean createInLocal) throws ScmException 
-	{
-		String dirPath = "";
-		Iterator<File> fit = fileSet.getFileList().iterator();
-		if( fit.hasNext() )
-		{
-			dirPath = fit.next().getPath().replace('\\', '/');
-		}
-		if( null == dirPath || dirPath.length() == 0 )
-		{
-			throw new ScmException("A relative directory path is required to execute this command!");
-		}
-		getLogger().info("Creating subprojects one per directory, as required for " + dirPath);
-		MkdirScmResult result;
-		IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository; 
-    	try
-    	{
-    		Response res = iRepo.getSandbox().createSubproject(dirPath);
-    		String subProject = res.getWorkItems().next().getResult().getField("resultant").getItem().getDisplayId();
-    		List<ScmFile> createdDirs = new ArrayList<ScmFile>();
-    		createdDirs.add(new ScmFile(subProject, ScmFileStatus.ADDED));
-    		int exitCode = res.getExitCode();
-    		boolean success = (exitCode == 0 ? true : false);
-    		getLogger().info("Successfully created subproject " + subProject);
-    		result = new MkdirScmResult(createdDirs, new ScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success)); 
-    	}
-    	catch(APIException aex)
-    	{
-    		ExceptionHandler eh = new ExceptionHandler(aex);
-    		getLogger().error("MKS API Exception: " + eh.getMessage());
-    		getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
-    		result = new MkdirScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
-    	}
-    	
-		return result;
-	}
+    /**
+     * Creates a subproject in the Integrity repository.
+     * <br>However, since the subproject automatically creates a folder in
+     * the local sandbox, the createInLocal argument will be ignored
+     */
+    @Override
+    public MkdirScmResult executeMkdirCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message,
+                                               boolean createInLocal )
+        throws ScmException
+    {
+        String dirPath = "";
+        Iterator<File> fit = fileSet.getFileList().iterator();
+        if ( fit.hasNext() )
+        {
+            dirPath = fit.next().getPath().replace( '\\', '/' );
+        }
+        if ( null == dirPath || dirPath.length() == 0 )
+        {
+            throw new ScmException( "A relative directory path is required to execute this command!" );
+        }
+        getLogger().info( "Creating subprojects one per directory, as required for " + dirPath );
+        MkdirScmResult result;
+        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
+        try
+        {
+            Response res = iRepo.getSandbox().createSubproject( dirPath );
+            String subProject = res.getWorkItems().next().getResult().getField( "resultant" ).getItem().getDisplayId();
+            List<ScmFile> createdDirs = new ArrayList<ScmFile>();
+            createdDirs.add( new ScmFile( subProject, ScmFileStatus.ADDED ) );
+            int exitCode = res.getExitCode();
+            boolean success = ( exitCode == 0 ? true : false );
+            getLogger().info( "Successfully created subproject " + subProject );
+            result = new MkdirScmResult( createdDirs,
+                                         new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode,
+                                                        success ) );
+        }
+        catch ( APIException aex )
+        {
+            ExceptionHandler eh = new ExceptionHandler( aex );
+            getLogger().error( "MKS API Exception: " + eh.getMessage() );
+            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
+            result = new MkdirScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
+        }
+
+        return result;
+    }
 
 }



Mime
View raw message