Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MWEBSTART-91 slight refactor for more readability

git-svn-id: http://svn.codehaus.org/mojo/trunk/mojo/webstart-maven-plugin@5931 52ab4f32-60fc-0310-b215-8acea882cd1b
  • Loading branch information...
commit d7846db506f2513a91d151911e14bd25445d06c3 1 parent 65944ff
lacostej authored
24 plugin/src/main/java/org/codehaus/mojo/webstart/AbstractBaseJnlpMojo.java
View
@@ -733,30 +733,24 @@ protected int removeExistingSignatures(File workDirectory, FileFilter updatedJar
// process jars
File[] jarFiles = workDirectory.listFiles( updatedJarFileFilter );
- JarUnsignMojo unsignJar = new JarUnsignMojo();
- unsignJar.setTempDir( tempDir );
- unsignJar.setVerbose( isVerbose() );
- unsignJar.setArchiverManager( archiverManager );
-
for ( int i = 0; i < jarFiles.length; i++ )
{
- if (isJarSigned(jarFiles[i]))
+ if ( isJarSigned( jarFiles[i] ) )
{
- unsignJar.setJarPath(jarFiles[i]);
- unsignJar.execute();
+ unsignJarFile( jarFiles[i], tempDir );
}
}
// cleanup tempDir
removeDirectory(tempDir);
- return jarFiles.length;
+ return jarFiles.length; // FIXME this is wrong. Not all jars are signed.
}
private boolean isJarSigned(File jarFile)
{
JarSignVerifyMojo verifyMojo = setupVerifyMojo();
- verifyMojo.setJarPath(jarFile);
+ verifyMojo.setJarPath( jarFile );
try {
verifyMojo.execute();
return true;
@@ -765,6 +759,16 @@ private boolean isJarSigned(File jarFile)
}
}
+ private void unsignJarFile(File jarFile, File tempDir) throws MojoExecutionException
+ {
+ JarUnsignMojo unsignJar = new JarUnsignMojo();
+ unsignJar.setTempDir( tempDir );
+ unsignJar.setVerbose( isVerbose() );
+ unsignJar.setArchiverManager( archiverManager );
+ unsignJar.setJarPath( jarFile );
+ unsignJar.execute();
+ }
+
/**
* Returns a configured instance of the JarSignVerifyMojo to test whether a
* jar is already signed. The Mojo throws an exception to indicate that a
Please sign in to comment.
Something went wrong with that request. Please try again.