diff options
author | Edwin L. Punzalan <epunzalan@apache.org> | 2006-10-26 09:15:23 +0000 |
---|---|---|
committer | Edwin L. Punzalan <epunzalan@apache.org> | 2006-10-26 09:15:23 +0000 |
commit | 2b1e907f1070d1ceef1f9e211363af3aacd2b95c (patch) | |
tree | 87e3dc71eb1d1c01c214771d04c1dc98359deb3a /archiva-webapp | |
parent | 15fe0128dd35bc08124b4ee76d59b360ad6541cb (diff) | |
download | archiva-2b1e907f1070d1ceef1f9e211363af3aacd2b95c.tar.gz archiva-2b1e907f1070d1ceef1f9e211363af3aacd2b95c.zip |
- verified copyright headers
- optimized imports
- ran code formatting
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@467926 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-webapp')
28 files changed, 294 insertions, 253 deletions
diff --git a/archiva-webapp/pom.xml b/archiva-webapp/pom.xml index 31c84b009..7103e4654 100644 --- a/archiva-webapp/pom.xml +++ b/archiva-webapp/pom.xml @@ -1,5 +1,4 @@ -<?xml version="1.0" ?> - +<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ @@ -120,8 +119,8 @@ <version>2.1-SNAPSHOT</version> <exclusions> <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-utils</artifactId> + <groupId>plexus</groupId> + <artifactId>plexus-utils</artifactId> </exclusion> </exclusions> </dependency> @@ -190,12 +189,12 @@ <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>1.2</version> - </dependency> + </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-mail-sender-javamail</artifactId> <version>1.0-alpha-3</version> - </dependency> + </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> @@ -239,13 +238,20 @@ <includes> <!-- TODO: META-INF shouldn't be required, seems to be an issue with the current war plugin --> <include>META-INF</include> - <include>WEB-INF/classes</include> <!-- Classes and Resources from other wars --> - <include>WEB-INF/lib</include> <!-- Dependencies from other wars --> - <include>WEB-INF/database</include> <!-- Database location configured in application.xml --> - <include>WEB-INF/logs</include> <!-- Log file location specified in application.xml --> - <include>pss</include> <!-- plexus-security css and javascript --> - <include>WEB-INF/jsp/pss</include> <!-- plexus-security jsps --> - <include>WEB-INF/template/pss</include> <!-- plexus-security xwork templates --> + <include>WEB-INF/classes</include> + <!-- Classes and Resources from other wars --> + <include>WEB-INF/lib</include> + <!-- Dependencies from other wars --> + <include>WEB-INF/database</include> + <!-- Database location configured in application.xml --> + <include>WEB-INF/logs</include> + <!-- Log file location specified in application.xml --> + <include>pss</include> + <!-- plexus-security css and javascript --> + <include>WEB-INF/jsp/pss</include> + <!-- plexus-security jsps --> + <include>WEB-INF/template/pss</include> + <!-- plexus-security xwork templates --> </includes> </fileset> </filesets> diff --git a/archiva-webapp/src/jetty-env.xml b/archiva-webapp/src/jetty-env.xml index 09d573d9f..4b577ef78 100644 --- a/archiva-webapp/src/jetty-env.xml +++ b/archiva-webapp/src/jetty-env.xml @@ -1,6 +1,21 @@ <?xml version="1.0"?> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> +<!-- + ~ Copyright 2005-2006 The Apache Software Foundation. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <New id="users" class="org.mortbay.jetty.plus.naming.Resource"> diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java index 10a6945ee..3db1c6b02 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java @@ -16,20 +16,18 @@ package org.apache.maven.archiva.web.action; * limitations under the License. */ +import com.opensymphony.webwork.interceptor.ServletResponseAware; import org.apache.maven.archiva.proxy.ProxyException; import org.apache.maven.archiva.proxy.ProxyManager; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.codehaus.plexus.xwork.action.PlexusActionSupport; +import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; -import com.opensymphony.webwork.interceptor.ServletResponseAware; - -import javax.servlet.http.HttpServletResponse; - /** * Proxy functionality. * diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java index 9b573b652..bc6f44321 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java @@ -31,8 +31,8 @@ import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; import org.apache.maven.archiva.indexer.lucene.LuceneQuery; import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryArtifactIndex; import org.apache.maven.archiva.indexer.record.StandardIndexRecordFields; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; import org.apache.maven.archiva.web.util.VersionMerger; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; import java.io.File; import java.net.MalformedURLException; diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java index 7ca7cb817..208d92597 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java @@ -28,6 +28,7 @@ import org.apache.maven.archiva.indexer.RepositoryIndexException; import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; import org.apache.maven.archiva.indexer.lucene.LuceneQuery; import org.apache.maven.archiva.indexer.record.StandardArtifactIndexRecord; +import org.apache.maven.archiva.web.util.VersionMerger; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; @@ -46,7 +47,6 @@ import org.apache.maven.report.projectinfo.dependencies.ReportResolutionListener import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.codehaus.plexus.xwork.action.PlexusActionSupport; -import org.apache.maven.archiva.web.util.VersionMerger; import java.io.File; import java.io.IOException; @@ -55,7 +55,6 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java index b86eaefb7..8d93a4d21 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java @@ -25,14 +25,14 @@ import org.apache.maven.archiva.configuration.ConfigurationStore; import org.apache.maven.archiva.configuration.ConfigurationStoreException; import org.apache.maven.archiva.configuration.InvalidConfigurationException; import org.apache.maven.archiva.security.ArchivaRoleConstants; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; +import org.codehaus.plexus.rbac.profile.RoleProfileException; +import org.codehaus.plexus.rbac.profile.RoleProfileManager; import org.codehaus.plexus.security.rbac.RbacManagerException; import org.codehaus.plexus.security.rbac.Resource; import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; -import org.codehaus.plexus.rbac.profile.RoleProfileException; -import org.codehaus.plexus.rbac.profile.RoleProfileManager; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; import java.io.IOException; diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java index a93f4dcae..63206a74d 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java @@ -23,11 +23,11 @@ import org.apache.maven.archiva.configuration.ConfigurationStore; import org.apache.maven.archiva.configuration.ConfigurationStoreException; import org.apache.maven.archiva.configuration.InvalidConfigurationException; import org.apache.maven.archiva.security.ArchivaRoleConstants; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; +import org.codehaus.plexus.security.rbac.Resource; import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; -import org.codehaus.plexus.security.rbac.Resource; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; import java.io.IOException; diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java index 78b5e1d94..3d2a3a396 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java @@ -18,11 +18,7 @@ package org.apache.maven.archiva.web.action.admin; import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryConfiguration; -import org.apache.maven.archiva.security.ArchivaRoleConstants; import org.codehaus.plexus.rbac.profile.RoleProfileException; -import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; -import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; -import org.codehaus.plexus.security.rbac.Resource; import java.io.File; import java.io.IOException; diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java index 8da33970d..e65d586dd 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java @@ -19,11 +19,11 @@ package org.apache.maven.archiva.web.action.admin; import org.apache.maven.archiva.scheduler.RepositoryTaskScheduler; import org.apache.maven.archiva.scheduler.TaskExecutionException; import org.apache.maven.archiva.security.ArchivaRoleConstants; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; +import org.codehaus.plexus.security.rbac.Resource; +import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; -import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; -import org.codehaus.plexus.security.rbac.Resource; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; /** * Configures the application. diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java index 1ab400de5..0e985135f 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java @@ -1,17 +1,7 @@ package org.apache.maven.archiva.web.check; -import org.apache.maven.archiva.configuration.ConfigurationStore; -import org.apache.maven.archiva.configuration.ConfigurationStoreException; -import org.apache.maven.archiva.configuration.RepositoryConfiguration; -import org.codehaus.plexus.rbac.profile.RoleProfileException; -import org.codehaus.plexus.rbac.profile.RoleProfileManager; -import org.codehaus.plexus.security.system.check.EnvironmentCheck; -import org.codehaus.plexus.logging.AbstractLogEnabled; - -import java.util.Iterator; -import java.util.List; /* - * Copyright 2006 The Apache Software Foundation. + * Copyright 2005-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +16,17 @@ import java.util.List; * limitations under the License. */ +import org.apache.maven.archiva.configuration.ConfigurationStore; +import org.apache.maven.archiva.configuration.ConfigurationStoreException; +import org.apache.maven.archiva.configuration.RepositoryConfiguration; +import org.codehaus.plexus.logging.AbstractLogEnabled; +import org.codehaus.plexus.rbac.profile.RoleProfileException; +import org.codehaus.plexus.rbac.profile.RoleProfileManager; +import org.codehaus.plexus.security.system.check.EnvironmentCheck; + +import java.util.Iterator; +import java.util.List; + /** * RoleExistanceEnvironmentCheck: * diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java index 1eade2b46..3970478f0 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java @@ -16,6 +16,8 @@ package org.apache.maven.archiva.web.servlet.repository; * limitations under the License. */ +import it.could.webdav.DAVTransaction; +import it.could.webdav.DAVUtilities; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.ConfigurationStore; import org.apache.maven.archiva.configuration.ConfigurationStoreException; @@ -33,19 +35,15 @@ import org.codehaus.plexus.security.ui.web.filter.authentication.HttpAuthenticat import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; -import it.could.webdav.DAVTransaction; -import it.could.webdav.DAVUtilities; - +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - /** * RepositoryAccess - access read/write to the repository. * diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryMapping.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryMapping.java index 587b88359..00957372a 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryMapping.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryMapping.java @@ -16,17 +16,16 @@ package org.apache.maven.archiva.web.servlet.repository; * limitations under the License. */ +import it.could.webdav.DAVListener; +import it.could.webdav.DAVProcessor; +import it.could.webdav.DAVRepository; +import it.could.webdav.DAVResource; import org.apache.maven.archiva.configuration.RepositoryConfiguration; import org.codehaus.plexus.logging.Logger; import java.io.File; import java.io.IOException; -import it.could.webdav.DAVListener; -import it.could.webdav.DAVProcessor; -import it.could.webdav.DAVRepository; -import it.could.webdav.DAVResource; - /** * RepositoryMapping * diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java index d74799f70..b926ed008 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java @@ -16,17 +16,17 @@ package org.apache.maven.archiva.web.util; * limitations under the License. */ -import org.apache.maven.model.Dependency; -import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.archiva.indexer.record.StandardArtifactIndexRecord; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; +import org.apache.maven.model.Dependency; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; -import java.util.List; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Set; diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java index 63b9f3995..16b6d8fce 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java @@ -1,62 +1,62 @@ -package org.apache.maven.archiva.web.validator; - -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.opensymphony.xwork.validator.validators.ValidatorSupport; -import com.opensymphony.xwork.validator.ValidationException; -import com.opensymphony.xwork.validator.ValidatorContext; - -/** - * - * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> - */ -public class IntervalValidator - extends ValidatorSupport -{ - - public void validate( Object obj ) - throws ValidationException - { - String snapshotsPolicy = ( String ) getFieldValue( "snapshotsPolicy", obj ); - String releasesPolicy = ( String ) getFieldValue( "releasesPolicy", obj ); - Integer snapshotsInterval = ( Integer ) getFieldValue( "snapshotsInterval", obj ); - Integer releasesInterval = ( Integer ) getFieldValue( "releasesInterval", obj ); - - ValidatorContext ctxt = getValidatorContext(); - - if( !snapshotsPolicy.equals( "interval" ) ) - { - if( snapshotsInterval.intValue() != 0 ) - { - ctxt.addActionError( "Snapshots Interval must be set to zero." ); - } - } - - if( !releasesPolicy.equals( "interval" ) ) - { - if( releasesInterval.intValue() != 0 ) - { - ctxt.addActionError( "Releases Interval must be set to zero." ); - } - } - - if( ctxt.hasActionErrors() ) - { - return; - } - } -} +package org.apache.maven.archiva.web.validator;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.opensymphony.xwork.validator.ValidationException;
+import com.opensymphony.xwork.validator.ValidatorContext;
+import com.opensymphony.xwork.validator.validators.ValidatorSupport;
+
+/**
+ *
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ */
+public class IntervalValidator
+ extends ValidatorSupport
+{
+
+ public void validate( Object obj )
+ throws ValidationException
+ {
+ String snapshotsPolicy = ( String ) getFieldValue( "snapshotsPolicy", obj );
+ String releasesPolicy = ( String ) getFieldValue( "releasesPolicy", obj );
+ Integer snapshotsInterval = ( Integer ) getFieldValue( "snapshotsInterval", obj );
+ Integer releasesInterval = ( Integer ) getFieldValue( "releasesInterval", obj );
+
+ ValidatorContext ctxt = getValidatorContext();
+
+ if( !snapshotsPolicy.equals( "interval" ) )
+ {
+ if( snapshotsInterval.intValue() != 0 )
+ {
+ ctxt.addActionError( "Snapshots Interval must be set to zero." );
+ }
+ }
+
+ if( !releasesPolicy.equals( "interval" ) )
+ {
+ if( releasesInterval.intValue() != 0 )
+ {
+ ctxt.addActionError( "Releases Interval must be set to zero." );
+ }
+ }
+
+ if( ctxt.hasActionErrors() )
+ {
+ return;
+ }
+ }
+}
diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java index 42977bd08..c515acf46 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java @@ -1,111 +1,111 @@ -package org.apache.maven.archiva.web.validator; - -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.opensymphony.xwork.validator.validators.ValidatorSupport; -import com.opensymphony.xwork.validator.ValidationException; -import com.opensymphony.xwork.validator.ValidatorContext; - -/** - * Validator for synced repository form. The values to be validated depends on the - * selected sync method to be used. - * - * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> - */ -public class SyncedRepositoryValidator - extends ValidatorSupport -{ - - public void validate( Object obj ) - throws ValidationException - { - - String method = ( String ) getFieldValue( "method", obj ); - ValidatorContext ctxt = getValidatorContext(); - - if( method.equals( "rsync" ) ) - { - String rsyncHost = ( String ) getFieldValue( "rsyncHost", obj ); - if( rsyncHost == null || rsyncHost.equals("") ) - { - ctxt.addActionError( "Rsync host is required." ); - } - - String rsyncDirectory = ( String ) getFieldValue( "rsyncDirectory", obj ); - if( rsyncDirectory == null || rsyncDirectory.equals("") ) - { - ctxt.addActionError( "Rsync directory is required." ); - } - - String rsyncMethod = ( String ) getFieldValue( "rsyncMethod", obj ); - if( rsyncMethod == null || rsyncMethod.equals("") ) - { - ctxt.addActionError( "Rsync method is required." ); - } - else - { - if( !rsyncMethod.equals( "anonymous" ) && !rsyncMethod.equals( "ssh" ) ) - { - ctxt.addActionError( "Invalid rsync method" ); - } - } - - String username = ( String ) getFieldValue( "username", obj ); - if( username == null || username.equals("") ) - { - ctxt.addActionError( "Username is required." ); - } - - } - else if ( method.equals( "svn" ) ) - { - String svnUrl = ( String ) getFieldValue( "svnUrl", obj ); - if( svnUrl == null || svnUrl.equals("") ) - { - ctxt.addActionError( "SVN url is required." ); - } - - String username = ( String ) getFieldValue( "username", obj ); - if( username == null || username.equals("") ) - { - ctxt.addActionError( "Username is required." ); - } - } - else if ( method.equals( "cvs" ) ) - { - String cvsRoot = ( String ) getFieldValue( "cvsRoot", obj ); - if( cvsRoot == null || cvsRoot.equals("") ) - { - ctxt.addActionError( "CVS root is required." ); - } - } - else if ( method.equals( "file" ) ) - { - String directory = ( String ) getFieldValue( "directory", obj ); - if( directory == null || directory.equals("") ) - { - ctxt.addActionError( "Directory is required." ); - } - } - - if( ctxt.hasActionErrors() ) - { - return; - } - } - -} +package org.apache.maven.archiva.web.validator;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.opensymphony.xwork.validator.ValidationException;
+import com.opensymphony.xwork.validator.ValidatorContext;
+import com.opensymphony.xwork.validator.validators.ValidatorSupport;
+
+/**
+ * Validator for synced repository form. The values to be validated depends on the
+ * selected sync method to be used.
+ *
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ */
+public class SyncedRepositoryValidator
+ extends ValidatorSupport
+{
+
+ public void validate( Object obj )
+ throws ValidationException
+ {
+
+ String method = ( String ) getFieldValue( "method", obj );
+ ValidatorContext ctxt = getValidatorContext();
+
+ if( method.equals( "rsync" ) )
+ {
+ String rsyncHost = ( String ) getFieldValue( "rsyncHost", obj );
+ if( rsyncHost == null || rsyncHost.equals("") )
+ {
+ ctxt.addActionError( "Rsync host is required." );
+ }
+
+ String rsyncDirectory = ( String ) getFieldValue( "rsyncDirectory", obj );
+ if( rsyncDirectory == null || rsyncDirectory.equals("") )
+ {
+ ctxt.addActionError( "Rsync directory is required." );
+ }
+
+ String rsyncMethod = ( String ) getFieldValue( "rsyncMethod", obj );
+ if( rsyncMethod == null || rsyncMethod.equals("") )
+ {
+ ctxt.addActionError( "Rsync method is required." );
+ }
+ else
+ {
+ if( !rsyncMethod.equals( "anonymous" ) && !rsyncMethod.equals( "ssh" ) )
+ {
+ ctxt.addActionError( "Invalid rsync method" );
+ }
+ }
+
+ String username = ( String ) getFieldValue( "username", obj );
+ if( username == null || username.equals("") )
+ {
+ ctxt.addActionError( "Username is required." );
+ }
+
+ }
+ else if ( method.equals( "svn" ) )
+ {
+ String svnUrl = ( String ) getFieldValue( "svnUrl", obj );
+ if( svnUrl == null || svnUrl.equals("") )
+ {
+ ctxt.addActionError( "SVN url is required." );
+ }
+
+ String username = ( String ) getFieldValue( "username", obj );
+ if( username == null || username.equals("") )
+ {
+ ctxt.addActionError( "Username is required." );
+ }
+ }
+ else if ( method.equals( "cvs" ) )
+ {
+ String cvsRoot = ( String ) getFieldValue( "cvsRoot", obj );
+ if( cvsRoot == null || cvsRoot.equals("") )
+ {
+ ctxt.addActionError( "CVS root is required." );
+ }
+ }
+ else if ( method.equals( "file" ) )
+ {
+ String directory = ( String ) getFieldValue( "directory", obj );
+ if( directory == null || directory.equals("") )
+ {
+ ctxt.addActionError( "Directory is required." );
+ }
+ }
+
+ if( ctxt.hasActionErrors() )
+ {
+ return;
+ }
+ }
+
+}
diff --git a/archiva-webapp/src/main/resources/META-INF/plexus/application.xml b/archiva-webapp/src/main/resources/META-INF/plexus/application.xml index ddf294dd9..d19eda1c2 100644 --- a/archiva-webapp/src/main/resources/META-INF/plexus/application.xml +++ b/archiva-webapp/src/main/resources/META-INF/plexus/application.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml index 771a8ab6b..6de73f94b 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml index 961cb7c8d..b47dc5732 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml index 60b774bc7..a4b6c4dc3 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml index cbff19aba..9f1863275 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ @@ -5,7 +6,7 @@ ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml index d94b4791d..7bc822e73 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml index a6297bc66..e9ca1b2f1 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ @@ -5,7 +6,7 @@ ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml index 6ca060037..6ce896027 100644 --- a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ @@ -5,7 +6,7 @@ ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, diff --git a/archiva-webapp/src/main/resources/validators.xml b/archiva-webapp/src/main/resources/validators.xml index 758717b03..8eb5c2429 100644 --- a/archiva-webapp/src/main/resources/validators.xml +++ b/archiva-webapp/src/main/resources/validators.xml @@ -1,18 +1,35 @@ -<validators> - <validator name="required" class="com.opensymphony.xwork.validator.validators.RequiredFieldValidator"/> - <validator name="requiredstring" class="com.opensymphony.xwork.validator.validators.RequiredStringValidator"/> - <validator name="int" class="com.opensymphony.xwork.validator.validators.IntRangeFieldValidator"/> - <validator name="double" class="com.opensymphony.xwork.validator.validators.DoubleRangeFieldValidator"/> - <validator name="date" class="com.opensymphony.xwork.validator.validators.DateRangeFieldValidator"/> - <validator name="expression" class="com.opensymphony.xwork.validator.validators.ExpressionValidator"/> - <validator name="fieldexpression" class="com.opensymphony.xwork.validator.validators.FieldExpressionValidator"/> - <validator name="email" class="com.opensymphony.xwork.validator.validators.EmailValidator"/> - <validator name="url" class="com.opensymphony.xwork.validator.validators.URLValidator"/> - <validator name="visitor" class="com.opensymphony.xwork.validator.validators.VisitorFieldValidator"/> - <validator name="conversion" class="com.opensymphony.xwork.validator.validators.ConversionErrorFieldValidator"/> - <validator name="stringlength" class="com.opensymphony.xwork.validator.validators.StringLengthFieldValidator"/> - <validator name="regex" class="com.opensymphony.xwork.validator.validators.RegexFieldValidator"/> - <validator name="interval" class="org.apache.maven.archiva.web.validator.IntervalValidator"/> - <validator name="syncedrepo" class="org.apache.maven.archiva.web.validator.SyncedRepositoryValidator"/> -</validators> - +<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright 2005-2006 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<validators>
+ <validator name="required" class="com.opensymphony.xwork.validator.validators.RequiredFieldValidator"/>
+ <validator name="requiredstring" class="com.opensymphony.xwork.validator.validators.RequiredStringValidator"/>
+ <validator name="int" class="com.opensymphony.xwork.validator.validators.IntRangeFieldValidator"/>
+ <validator name="double" class="com.opensymphony.xwork.validator.validators.DoubleRangeFieldValidator"/>
+ <validator name="date" class="com.opensymphony.xwork.validator.validators.DateRangeFieldValidator"/>
+ <validator name="expression" class="com.opensymphony.xwork.validator.validators.ExpressionValidator"/>
+ <validator name="fieldexpression" class="com.opensymphony.xwork.validator.validators.FieldExpressionValidator"/>
+ <validator name="email" class="com.opensymphony.xwork.validator.validators.EmailValidator"/>
+ <validator name="url" class="com.opensymphony.xwork.validator.validators.URLValidator"/>
+ <validator name="visitor" class="com.opensymphony.xwork.validator.validators.VisitorFieldValidator"/>
+ <validator name="conversion" class="com.opensymphony.xwork.validator.validators.ConversionErrorFieldValidator"/>
+ <validator name="stringlength" class="com.opensymphony.xwork.validator.validators.StringLengthFieldValidator"/>
+ <validator name="regex" class="com.opensymphony.xwork.validator.validators.RegexFieldValidator"/>
+ <validator name="interval" class="org.apache.maven.archiva.web.validator.IntervalValidator"/>
+ <validator name="syncedrepo" class="org.apache.maven.archiva.web.validator.SyncedRepositoryValidator"/>
+</validators>
+
diff --git a/archiva-webapp/src/main/resources/xwork.xml b/archiva-webapp/src/main/resources/xwork.xml index 35ac7aa93..021d2e9cb 100644 --- a/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-webapp/src/main/resources/xwork.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml b/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml index 03131ae9f..54fced097 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml +++ b/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/main/webapp/WEB-INF/web.xml b/archiva-webapp/src/main/webapp/WEB-INF/web.xml index 88c26e056..624c7205b 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/web.xml +++ b/archiva-webapp/src/main/webapp/WEB-INF/web.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ diff --git a/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.xml b/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.xml index 24fd42912..016231648 100644 --- a/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.xml +++ b/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- ~ Copyright 2005-2006 The Apache Software Foundation. ~ |