Author: dennisl
Date: Sat Aug 10 12:07:50 2013
New Revision: 1512663

URL: http://svn.apache.org/r1512663
Log:
Refactoring: extract method.

Modified:
    
maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java

Modified: 
maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java?rev=1512663&r1=1512662&r2=1512663&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
 (original)
+++ 
maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
 Sat Aug 10 12:07:50 2013
@@ -179,6 +179,26 @@ public class GpgSigner
         }
 
         // 
----------------------------------------------------------------------------
+        // Generate the signature file
+        // 
----------------------------------------------------------------------------
+
+        generateSignatureForFile( file, signature );
+
+        return signature;
+    }
+
+    /**
+     * Generate the detached signature file for the provided file.
+     *
+     * @param file The file to sign
+     * @param signature The file in which the generate signature will be put
+     * @return A reference to the generated signature file
+     * @throws MojoExecutionException
+     */
+    protected void generateSignatureForFile( File file, File signature )
+        throws MojoExecutionException
+    {
+        // 
----------------------------------------------------------------------------
         // Set up the command line
         // 
----------------------------------------------------------------------------
 
@@ -277,8 +297,6 @@ public class GpgSigner
         {
             throw new MojoExecutionException( "Unable to execute gpg command", 
e );
         }
-
-        return signature;
     }
 
     private MavenProject findReactorProject( MavenProject prj )


Reply via email to