dion 02/05/20 17:30:35
Modified: src/java/org/apache/maven/j2ee WarValidator.java
Log:
Checkstyle issues
Revision Changes Path
1.20 +23 -35
jakarta-turbine-maven/src/java/org/apache/maven/j2ee/WarValidator.java
Index: WarValidator.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/j2ee/WarValidator.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- WarValidator.java 21 May 2002 00:01:12 -0000 1.19
+++ WarValidator.java 21 May 2002 00:30:35 -0000 1.20
@@ -55,28 +55,11 @@
*/
import java.io.File;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.zip.ZipException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
-import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Reference;
import org.apache.maven.executor.AbstractExecutor;
import org.apache.maven.j2ee.war.FormLoginConfig;
@@ -100,7 +83,7 @@
* ></code> element must exist in the war file</li>
* </ol>
* @author dIon Gillard
- * @version $Id: WarValidator.java,v 1.19 2002/05/21 00:01:12 dion Exp $
+ * @version $Id: WarValidator.java,v 1.20 2002/05/21 00:30:35 dion Exp $
*/
public class WarValidator extends AbstractExecutor
{
@@ -151,6 +134,7 @@
/**
* Perform the validation.
+ * @throws Exception when any error occurs
*/
public void execute() throws Exception
{
@@ -161,7 +145,7 @@
validate();
if (getStatus().isError() && isFailOnError())
{
- throw new BuildException("Errors occurred during validation. "+
+ throw new BuildException("Errors occurred during validation. " +
"Messages should have been provided");
}
}
@@ -181,7 +165,7 @@
}
finally
{
- getBroadcaster().fireEndedEvent( new ValidationEvent(this,
+ getBroadcaster().fireEndedEvent(new ValidationEvent(this,
getWarFileName(), "war validation ended"));
}
}
@@ -191,7 +175,7 @@
*/
protected void startValidation()
{
- getBroadcaster().fireStartedEvent( new ValidationEvent(this,
+ getBroadcaster().fireStartedEvent(new ValidationEvent(this,
getWarFileName(), "war validation started"));
validateFile();
}
@@ -207,7 +191,7 @@
*/
protected void endValidation()
{
- getBroadcaster().fireEndedEvent( new ValidationEvent(this,
+ getBroadcaster().fireEndedEvent(new ValidationEvent(this,
getWarFileName(), "war validation ended"));
}
@@ -232,7 +216,6 @@
}
/** Validate the web.xml entry in the provided jar file.
- * @param jarFile - a jar file with a known WEB-INF/web.xml
*/
private void validateWebXml()
{
@@ -265,6 +248,7 @@
* <code><servlet></code> tag in web.xml), making sure that their
* class defined can be loaded from the war and is not part of the
* external classpath
+ * @param war the war file to validate
* @throws IOException when there are any issues reading the war file
*/
private void validateServlets(WarFile war) throws IOException
@@ -281,7 +265,7 @@
{
entry = (Map.Entry) entries.next();
className = (String) entry.getValue();
- getBroadcaster().fireInformationEvent( new ValidationEvent(this,
+ getBroadcaster().fireInformationEvent(new ValidationEvent(this,
getWarFileName(), "validating servlet name: " +
entry.getKey() + " class: " + className));
// check each servlet by loading the class
@@ -294,6 +278,7 @@
* <code><servlet></code> tag with a nested <code><jsp-file>
* </code> in web.xml), making sure that the resource specifed by
* <code><jsp-file></code> exists in the war file
+ * @param war the war file to validate
* @throws IOException when there are any issues reading the war file
*/
private void validateJSPs(WarFile war) throws IOException
@@ -307,13 +292,13 @@
{
entry = (Map.Entry)entries.next();
String jspFile = (String)entry.getValue();
- getBroadcaster().fireInformationEvent( new ValidationEvent(this,
+ getBroadcaster().fireInformationEvent(new ValidationEvent(this,
getWarFileName(), "validating servlet name: " +
entry.getKey() + " jsp file: " + jspFile));
if (!war.hasFile(jspFile))
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "JSP File: '" + jspFile +
"' not found"));
}
@@ -334,19 +319,19 @@
if (clazz.getClassLoader() != loader)
{
// loaded from classpath - a no no.
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "class (" + className + ") loaded from " +
"system classpath rather than war file"));
}
}
catch (ClassNotFoundException e)
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "class (" + className + ") not found "));
}
catch (NoClassDefFoundError error)
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "class (" + className + ") was found, but a "
+ "referenced class was missing: " + error.getMessage()));
}
@@ -357,6 +342,7 @@
* <code><taglib></code> tag in web.xml), making sure that the
* resource specifed by <code><taglib-location></code> exists in the
* war file
+ * @param war the war file to validate
* @throws IOException when there are any issues reading the war file
*/
private void validateTaglibs(WarFile war) throws IOException
@@ -371,11 +357,11 @@
entry = (Map.Entry)entries.next();
String uri = (String)entry.getKey();
String location = (String)entry.getValue();
- getBroadcaster().fireInformationEvent( new ValidationEvent(this,
+ getBroadcaster().fireInformationEvent(new ValidationEvent(this,
getWarFileName(), "validating taglib uri: " + uri));
if (!war.hasFile(location))
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "Taglib location: '" + location +
"' not found"));
}
@@ -387,6 +373,7 @@
* <code><error-page></code> tag in web.xml), making sure that the
* location specifed by the nested <code><location></code> exists in
* the war file
+ * @param war the war file to validate
* @throws IOException when there are any issues reading the war file
*/
public void validateErrorPages(WarFile war) throws IOException
@@ -401,12 +388,12 @@
entry = (Map.Entry)entries.next();
String errorQualifier = (String)entry.getKey();
String location = (String)entry.getValue();
- getBroadcaster().fireInformationEvent( new ValidationEvent(this,
+ getBroadcaster().fireInformationEvent(new ValidationEvent(this,
getWarFileName(), "validating error page for: " +
errorQualifier));
if (!war.hasFile(location))
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "Error page location: '" + location +
"' not found"));
}
@@ -416,6 +403,7 @@
/** validate that the <code><form-login-config></code> element, if it
* exists contains valid login and error pages
+ * @param war the war file to validate
* @throws IOException when there are any issues reading the war file
*/
public void validateFormLoginConfig(WarFile war) throws IOException
@@ -425,13 +413,13 @@
{
if (!war.hasFile(config.getLoginPage()))
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "<form-config-login> login-page location:"
+ " '" + config.getLoginPage() + "' not found"));
}
if (!war.hasFile(config.getErrorPage()))
{
- getBroadcaster().fireErrorEvent( new ValidationEvent(this,
+ getBroadcaster().fireErrorEvent(new ValidationEvent(this,
getWarFileName(), "<form-config-login> error-page location:"
+ " '" + config.getErrorPage() + "' not found"));
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>