activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r565003 [1/17] - in /activemq/trunk: activemq-fileserver/src/main/java/org/apache/activemq/util/ activemq-fileserver/src/test/java/org/apache/activemq/util/ activemq-jaas/src/main/java/org/apache/activemq/jaas/ activemq-jaas/src/test/java/o...
Date Sun, 12 Aug 2007 05:27:34 GMT
Author: chirino
Date: Sat Aug 11 22:27:21 2007
New Revision: 565003

URL: http://svn.apache.org/viewvc?view=rev&rev=565003
Log:
Last set of checkstyle violation fixes

Modified:
    activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
    activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/RestFilter.java
    activemq/trunk/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateCallback.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateLoginModule.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/GroupPrincipal.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JassCredentialCallbackHandler.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/TextFileCertificateLoginModule.java
    activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/UserPrincipal.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/CertificateLoginModuleTest.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/GroupPrincipalTest.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/LDAPLoginModuleTest.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/StubCertificateLoginModule.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/UserPrincipalTest.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/ldap/MutableServerStartupConfiguration.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/ldap/ServerContextFactory.java
    activemq/trunk/activemq-jaas/src/test/java/org/apache/activemq/jaas/ldap/ServerStartupConfiguration.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAMessageStore.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAPersistenceAdapter.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAReferenceStore.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAReferenceStoreAdapter.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicReferenceStore.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredMessage.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredMessageReference.java
    activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredSubscription.java
    activemq/trunk/activemq-jpa-store/src/test/java/org/apache/activemq/broker/store/JPAStoreLoadTester.java
    activemq/trunk/activemq-jpa-store/src/test/java/org/apache/activemq/broker/store/QuickJPAStoreLoadTester.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CGeneratorTask.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpClassesGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpGeneratorTask.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpMarshallingGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSourcesGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CppClassesGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CppGeneratorTask.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CppHeadersGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CppMarshallingClassesGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CppMarshallingHeadersGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaMarshallingGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaTestsGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/MultiSourceGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/OpenWireGenerator.java
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/SingleSourceGenerator.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Consumer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/ProducerConsumer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/XMLBeansXPathEvaluator.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ConsumerTool.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ProducerTool.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ToolSupport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/WebServer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/BlockingQueueTransport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpEmbeddedTunnelServlet.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpSpringEmbeddedTunnelServlet.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTunnelServlet.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/https/HttpsTransportServer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/util/TextWireFormat.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JmsLogAppender.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JmsLogAppenderSupport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JndiJmsLogAppender.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/xstream/XStreamMessageTransformer.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpTransportBrokerTest.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsTransportBrokerTest.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/xstream/XStreamWireFormatTest.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/util/JmsLogAppenderTest.java
    activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/util/xstream/XStreamTransformTest.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionFactory.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointActivationKey.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnectionFactory.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundConnectionProxy.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundContext.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundContextSupport.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundSessionProxy.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/LocalAndXATransaction.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedConnectionProxy.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedSessionProxy.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageActivationSpec.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageEndpointProxy.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageResourceAdapter.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionImpl.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/SimpleConnectionManager.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQActivationSpecTest.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQAsfEndpointWorkerTest.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQResourceAdapterJavaBeanEqualityTest.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/ConnectionManagerAdapter.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/MDBTest.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionFactoryTest.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionTest.java
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/MessageEndpointProxyTest.java
    activemq/trunk/activemq-test-atomikos/src/test/java/org/apache/activemq/atomikos/XATest.java
    activemq/trunk/activemq-tooling/maven-activemq-memtest-plugin/src/main/java/org/apache/activemq/maven/MemtestMojo.java
    activemq/trunk/activemq-tooling/maven-activemq-memtest-plugin/src/main/java/org/apache/activemq/tool/JMSMemtest.java
    activemq/trunk/activemq-tooling/maven-activemq-memtest-plugin/src/main/java/org/apache/activemq/tool/MemConsumer.java
    activemq/trunk/activemq-tooling/maven-activemq-memtest-plugin/src/main/java/org/apache/activemq/tool/MemMessageIdList.java
    activemq/trunk/activemq-tooling/maven-activemq-memtest-plugin/src/main/java/org/apache/activemq/tool/MemoryMonitoringTool.java
    activemq/trunk/activemq-tooling/maven-activemq-memtest-plugin/src/main/java/org/apache/activemq/tool/ReportGenerator.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ConsumerMojo.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ProducerMojo.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ServerMojo.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClientSystem.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsMeasurableClient.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/JmsClientProperties.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/JmsClientSystemProperties.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/JmsConsumerProperties.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/JmsProducerProperties.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionConfigurable.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/AbstractPerfReportWriter.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/PerformanceReportWriter.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/PerformanceStatisticsUtil.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/VerbosePerfReportWriter.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/XmlFilePerfReportWriter.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/CpuReportPlugin.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ReportPlugin.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ThroughputReportPlugin.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/AbstractPerformanceSampler.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/CpuSamplerTask.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/MeasurableClient.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceEventListener.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceSampler.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/ThroughputSamplerTask.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/CpuSamplerPlugin.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/LinuxCpuSamplerPlugin.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ActiveMQPojoSPI.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ClassLoaderSPIConnectionFactory.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ReflectionSPIConnectionFactory.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/SPIConnectionFactory.java
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java
    activemq/trunk/activemq-tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacade.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/DestinationFacade.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/LocalBrokerFacade.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/MessageQuery.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/QueueBrowseQuery.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/SessionPool.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/SingletonBrokerFacade.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/WebConsoleStarter.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/CreateDestination.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/CreateSubscriber.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/DeleteDestination.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/DeleteMessage.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/DeleteSubscriber.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/SendMessage.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/handler/BindingBeanNameUrlHandlerMapping.java
    activemq/trunk/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/QueueBrowseServlet.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionFilter.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SpringBrokerContextListener.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/view/MessageRenderer.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/view/RssMessageRenderer.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/view/SimpleMessageRenderer.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/view/XmlMessageRenderer.java
    activemq/trunk/activemq-web/src/test/java/org/apache/activemq/web/JettyServer.java
    activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java
    activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
    activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java
    activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java
    activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java
    activemq/trunk/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppBroker.java
    activemq/trunk/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppTest.java
    activemq/trunk/assembly/src/release/example/src/CommandLineSupport.java
    activemq/trunk/assembly/src/release/example/src/ConsumerTool.java
    activemq/trunk/assembly/src/release/example/src/EmbeddedBroker.java
    activemq/trunk/assembly/src/release/example/src/ProducerAndConsumerTool.java
    activemq/trunk/assembly/src/release/example/src/ProducerTool.java
    activemq/trunk/assembly/src/release/example/src/RequesterTool.java
    activemq/trunk/assembly/src/release/example/src/TopicListener.java
    activemq/trunk/assembly/src/release/example/src/TopicPublisher.java
    activemq/trunk/assembly/src/test/java/org/apache/activemq/benchmark/BenchmarkSupport.java
    activemq/trunk/assembly/src/test/java/org/apache/activemq/benchmark/Consumer.java
    activemq/trunk/assembly/src/test/java/org/apache/activemq/benchmark/Producer.java
    activemq/trunk/assembly/src/test/java/org/apache/activemq/benchmark/ProducerConsumer.java
    activemq/trunk/assembly/src/test/java/org/apache/activemq/config/BrokerXmlConfigTest.java

Modified: activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java (original)
+++ activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java Sat Aug 11 22:27:21 2007
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
 package org.apache.activemq.util;
 
 import java.io.IOException;
@@ -15,61 +31,60 @@
 
 public class FilenameGuardFilter implements Filter {
 
-	public void destroy() {
-		// nothing to destroy		
-	}
-
-	public void init(FilterConfig config) throws ServletException {
-		// nothing to init		
-	}
-
-	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
-		if (request instanceof HttpServletRequest) {
-			HttpServletRequest httpRequest = (HttpServletRequest)request;
-			GuardedHttpServletRequest guardedRequest = new GuardedHttpServletRequest(httpRequest);
-			chain.doFilter(guardedRequest, response);
-		} else {
-			chain.doFilter(request, response);
-		}		
-	}
-	
-	private static class GuardedHttpServletRequest extends HttpServletRequestWrapper {
-		
-		public GuardedHttpServletRequest(HttpServletRequest httpRequest) {
-			super(httpRequest);
-		}
-
-		private String guard(String filename) {
-			String guarded = filename.replace(":", "_");
-			if (Log.isDebugEnabled()) 
-			{
-				Log.debug("guarded " + filename + " to "+ guarded);
-			}
-			return guarded;
-		}
-		
-		@Override
-		public String getParameter(String name) {
-			if (name.equals("Destination")) {
-				return guard(super.getParameter(name));
-			} else {
-				return super.getParameter(name);
-			}
-		}
-		
-		@Override
-		public String getPathInfo() {
-			return guard(super.getPathInfo());
-		}
-		
-		@Override
-		public String getPathTranslated() {
-			return guard(super.getPathTranslated());
-		}
-		
-		@Override
-		public String getRequestURI() {
-			return guard(super.getRequestURI());
-		}
-	}
+    public void destroy() {
+        // nothing to destroy
+    }
+
+    public void init(FilterConfig config) throws ServletException {
+        // nothing to init
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+        if (request instanceof HttpServletRequest) {
+            HttpServletRequest httpRequest = (HttpServletRequest)request;
+            GuardedHttpServletRequest guardedRequest = new GuardedHttpServletRequest(httpRequest);
+            chain.doFilter(guardedRequest, response);
+        } else {
+            chain.doFilter(request, response);
+        }
+    }
+
+    private static class GuardedHttpServletRequest extends HttpServletRequestWrapper {
+
+        public GuardedHttpServletRequest(HttpServletRequest httpRequest) {
+            super(httpRequest);
+        }
+
+        private String guard(String filename) {
+            String guarded = filename.replace(":", "_");
+            if (Log.isDebugEnabled()) {
+                Log.debug("guarded " + filename + " to " + guarded);
+            }
+            return guarded;
+        }
+
+        @Override
+        public String getParameter(String name) {
+            if (name.equals("Destination")) {
+                return guard(super.getParameter(name));
+            } else {
+                return super.getParameter(name);
+            }
+        }
+
+        @Override
+        public String getPathInfo() {
+            return guard(super.getPathInfo());
+        }
+
+        @Override
+        public String getPathTranslated() {
+            return guard(super.getPathTranslated());
+        }
+
+        @Override
+        public String getRequestURI() {
+            return guard(super.getRequestURI());
+        }
+    }
 }

Modified: activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/RestFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/RestFilter.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/RestFilter.java (original)
+++ activemq/trunk/activemq-fileserver/src/main/java/org/apache/activemq/util/RestFilter.java Sat Aug 11 22:27:21 2007
@@ -1,19 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
 //========================================================================
 //Copyright 2007 CSC - Scientific Computing Ltd.
-//------------------------------------------------------------------------
-//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.
 //========================================================================
-
 package org.apache.activemq.util;
 
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -32,210 +38,191 @@
 import org.mortbay.log.Log;
 import org.mortbay.util.IO;
 import org.mortbay.util.URIUtil;
-
 import sun.net.www.protocol.http.HttpURLConnection;
 
 /**
-* <p>Adds support for HTTP PUT, MOVE and 
-* DELETE methods. If init parameters read-permission-role and write-permission-role
-* are defined then all requests are authorized using the defined roles. Also GET methods are
-* authorized. </p>
-*   
-* @author Aleksi Kallio
-*
-*/
+ * <p>
+ * Adds support for HTTP PUT, MOVE and DELETE methods. If init parameters
+ * read-permission-role and write-permission-role are defined then all requests
+ * are authorized using the defined roles. Also GET methods are authorized.
+ * </p>
+ * 
+ * @author Aleksi Kallio
+ */
 public class RestFilter implements Filter {
 
-	private static final String HTTP_HEADER_DESTINATION = "Destination";
-	private static final String HTTP_METHOD_MOVE = "MOVE";
-	private static final String HTTP_METHOD_PUT = "PUT";
-	private static final String HTTP_METHOD_GET = "GET";
-	private static final String HTTP_METHOD_DELETE = "DELETE";
-	
-	private String readPermissionRole = null;
-	private String writePermissionRole = null;
-	private FilterConfig filterConfig;
-
-	public void init(FilterConfig filterConfig) throws UnavailableException 
-	{
-		this.filterConfig = filterConfig;
-		readPermissionRole = filterConfig.getInitParameter("read-permission-role");
-		writePermissionRole = filterConfig.getInitParameter("write-permission-role");		
-	}
-	
-	private File locateFile(HttpServletRequest request) 
-	{		
-		return new File(filterConfig.getServletContext().getRealPath(URIUtil.addPaths(request.getServletPath(),request.getPathInfo())));		
-	}
-
-	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
-	{
-		if (!(request instanceof HttpServletRequest && response instanceof HttpServletResponse)) 
-		{
-			if (Log.isDebugEnabled()) 
-			{
-				Log.debug("request not HTTP, can not understand: " + request.toString());
-			}
-			chain.doFilter(request, response);
-			return;
-		}
-		
-		HttpServletRequest httpRequest = (HttpServletRequest)request;
-		HttpServletResponse httpResponse = (HttpServletResponse)response;
-		
-		if (httpRequest.getMethod().equals(HTTP_METHOD_MOVE)) 
-		{
-			doMove(httpRequest, httpResponse);
-		}
-		else if (httpRequest.getMethod().equals(HTTP_METHOD_PUT))
-		{
-			doPut(httpRequest, httpResponse);			
-		}
-		else if (httpRequest.getMethod().equals(HTTP_METHOD_GET))
-		{
-			if (checkGet(httpRequest, httpResponse)) { 
-				chain.doFilter(httpRequest, httpResponse); // actual processing done elsewhere
-			}
-		}
-		else if (httpRequest.getMethod().equals(HTTP_METHOD_DELETE))
-		{
-			doDelete(httpRequest, httpResponse);
-		}
-		else
-		{
-			chain.doFilter(httpRequest, httpResponse);
-		}
-	}
-	
-	protected void doMove(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
-	{
-		if (Log.isDebugEnabled()) 
-		{
-			Log.debug("RESTful file access: MOVE request for " + request.getRequestURI());
-		}
-
-		if (writePermissionRole != null && !request.isUserInRole(writePermissionRole)) 
-		{			
-	    	response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
-	    	return;
-		}
-
-		File file = locateFile(request);		
-		String destination = request.getHeader(HTTP_HEADER_DESTINATION);
-		
-    	if (destination == null) 
-    	{
-    		response.sendError(HttpURLConnection.HTTP_BAD_REQUEST, "Destination header not found"); 
-    		return;
-    	}
-    	
-    	try 
-    	{
-    		URL destinationUrl = new URL(destination);
-    		IO.copyFile(file, new File(destinationUrl.getFile()));
-    		IO.delete(file);
-    	} 
-    	catch (IOException e) 
-    	{
-			response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR); // file could not be moved   
-			return;
-    	}
-    	
-    	response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return no content
-	}
-
-	protected boolean checkGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		if (Log.isDebugEnabled()) 
-		{
-			Log.debug("RESTful file access: GET request for " + request.getRequestURI());
-		}
-
-		if (readPermissionRole != null && !request.isUserInRole(readPermissionRole)) 
-		{			
-			response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
-			return false;
-		} else {
-			return true;
-		}
-	}
-	
-	
-	protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
-	{
-		if (Log.isDebugEnabled()) 
-		{
-			Log.debug("RESTful file access: PUT request for " + request.getRequestURI());
-		}
-		
-		if (writePermissionRole != null && !request.isUserInRole(writePermissionRole)) 
-		{			
-			response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
-			return;
-		}
-		
-		File file = locateFile(request);
-		
-		if (file.exists()) 
-		{
-			boolean success = file.delete(); // replace file if it exists
-			if (!success) 
-			{
-				response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR); // file existed and could not be deleted
-				return;
-			}
-		}
-		
-		FileOutputStream out = new FileOutputStream(file);
-		try 
-		{
-			IO.copy(request.getInputStream(), out);
-		} 
-		catch (IOException e) 
-		{
-			Log.warn(Log.EXCEPTION, e); // is this obsolete?
-			out.close();
-			throw(e);
-		}
-		
-		response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return no content
-	}
-	
-	protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
-	{
-		if (Log.isDebugEnabled()) 
-		{
-			Log.debug("RESTful file access: DELETE request for " + request.getRequestURI());
-		}
-		
-		if (writePermissionRole != null && !request.isUserInRole(writePermissionRole)) 
-		{			
-			response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
-			return;
-		}
-		
-		File file = locateFile(request);
-		
-		if (!file.exists()) 
-		{
-			response.sendError(HttpURLConnection.HTTP_NOT_FOUND); // file not found
-			return;
-		} 
-		
-		boolean success = IO.delete(file); // actual delete operation
-		
-		if (success) 
-		{
-			response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return no content
-		} 
-		else 
-		{
-			response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR); // could not be deleted due to internal error
-		}
-	}
-	
-	public void destroy() 
-	{
-		// nothing to destroy
-	}
+    private static final String HTTP_HEADER_DESTINATION = "Destination";
+    private static final String HTTP_METHOD_MOVE = "MOVE";
+    private static final String HTTP_METHOD_PUT = "PUT";
+    private static final String HTTP_METHOD_GET = "GET";
+    private static final String HTTP_METHOD_DELETE = "DELETE";
+
+    private String readPermissionRole;
+    private String writePermissionRole;
+    private FilterConfig filterConfig;
+
+    public void init(FilterConfig filterConfig) throws UnavailableException {
+        this.filterConfig = filterConfig;
+        readPermissionRole = filterConfig.getInitParameter("read-permission-role");
+        writePermissionRole = filterConfig.getInitParameter("write-permission-role");
+    }
+
+    private File locateFile(HttpServletRequest request) {
+        return new File(filterConfig.getServletContext().getRealPath(URIUtil.addPaths(request.getServletPath(), request.getPathInfo())));
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+        if (!(request instanceof HttpServletRequest && response instanceof HttpServletResponse)) {
+            if (Log.isDebugEnabled()) {
+                Log.debug("request not HTTP, can not understand: " + request.toString());
+            }
+            chain.doFilter(request, response);
+            return;
+        }
+
+        HttpServletRequest httpRequest = (HttpServletRequest)request;
+        HttpServletResponse httpResponse = (HttpServletResponse)response;
+
+        if (httpRequest.getMethod().equals(HTTP_METHOD_MOVE)) {
+            doMove(httpRequest, httpResponse);
+        } else if (httpRequest.getMethod().equals(HTTP_METHOD_PUT)) {
+            doPut(httpRequest, httpResponse);
+        } else if (httpRequest.getMethod().equals(HTTP_METHOD_GET)) {
+            if (checkGet(httpRequest, httpResponse)) {
+                chain.doFilter(httpRequest, httpResponse); // actual processing
+                                                            // done elsewhere
+            }
+        } else if (httpRequest.getMethod().equals(HTTP_METHOD_DELETE)) {
+            doDelete(httpRequest, httpResponse);
+        } else {
+            chain.doFilter(httpRequest, httpResponse);
+        }
+    }
+
+    protected void doMove(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        if (Log.isDebugEnabled()) {
+            Log.debug("RESTful file access: MOVE request for " + request.getRequestURI());
+        }
+
+        if (writePermissionRole != null && !request.isUserInRole(writePermissionRole)) {
+            response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
+            return;
+        }
+
+        File file = locateFile(request);
+        String destination = request.getHeader(HTTP_HEADER_DESTINATION);
+
+        if (destination == null) {
+            response.sendError(HttpURLConnection.HTTP_BAD_REQUEST, "Destination header not found");
+            return;
+        }
+
+        try {
+            URL destinationUrl = new URL(destination);
+            IO.copyFile(file, new File(destinationUrl.getFile()));
+            IO.delete(file);
+        } catch (IOException e) {
+            response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR); // file
+                                                                        // could
+                                                                        // not
+                                                                        // be
+                                                                        // moved
+            return;
+        }
+
+        response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return no
+                                                                // content
+    }
+
+    protected boolean checkGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        if (Log.isDebugEnabled()) {
+            Log.debug("RESTful file access: GET request for " + request.getRequestURI());
+        }
+
+        if (readPermissionRole != null && !request.isUserInRole(readPermissionRole)) {
+            response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        if (Log.isDebugEnabled()) {
+            Log.debug("RESTful file access: PUT request for " + request.getRequestURI());
+        }
+
+        if (writePermissionRole != null && !request.isUserInRole(writePermissionRole)) {
+            response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
+            return;
+        }
+
+        File file = locateFile(request);
+
+        if (file.exists()) {
+            boolean success = file.delete(); // replace file if it exists
+            if (!success) {
+                response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR); // file
+                                                                            // existed
+                                                                            // and
+                                                                            // could
+                                                                            // not
+                                                                            // be
+                                                                            // deleted
+                return;
+            }
+        }
+
+        FileOutputStream out = new FileOutputStream(file);
+        try {
+            IO.copy(request.getInputStream(), out);
+        } catch (IOException e) {
+            Log.warn(Log.EXCEPTION, e); // is this obsolete?
+            out.close();
+            throw e;
+        }
+
+        response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return no
+                                                                // content
+    }
+
+    protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        if (Log.isDebugEnabled()) {
+            Log.debug("RESTful file access: DELETE request for " + request.getRequestURI());
+        }
+
+        if (writePermissionRole != null && !request.isUserInRole(writePermissionRole)) {
+            response.sendError(HttpURLConnection.HTTP_FORBIDDEN);
+            return;
+        }
+
+        File file = locateFile(request);
+
+        if (!file.exists()) {
+            response.sendError(HttpURLConnection.HTTP_NOT_FOUND); // file not
+                                                                    // found
+            return;
+        }
+
+        boolean success = IO.delete(file); // actual delete operation
+
+        if (success) {
+            response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return
+                                                                    // no
+                                                                    // content
+        } else {
+            response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR); // could
+                                                                        // not
+                                                                        // be
+                                                                        // deleted
+                                                                        // due
+                                                                        // to
+                                                                        // internal
+                                                                        // error
+        }
+    }
+
+    public void destroy() {
+        // nothing to destroy
+    }
 }
-

Modified: activemq/trunk/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java (original)
+++ activemq/trunk/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java Sat Aug 11 22:27:21 2007
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
 package org.apache.activemq.util;
 
 import java.io.ByteArrayInputStream;
@@ -12,45 +28,47 @@
 import org.mortbay.util.IO;
 
 public class RestFilterTest extends TestCase {
-	
-	public RestFilterTest(String s) {
-		super(s);
-	}
-	
-	public void test() throws Exception {
-		byte[] fileContents = new byte[] {'a', 'b', 'c'};	
-		URL url = new URL("http://localhost:8080/fileserver/repository/file.txt");
 
-		// 1. upload
+    public RestFilterTest(String s) {
+        super(s);
+    }
+
+    public void test() throws Exception {
+        byte[] fileContents = new byte[] {
+            'a', 'b', 'c'
+        };
+        URL url = new URL("http://localhost:8080/fileserver/repository/file.txt");
+
+        // 1. upload
         HttpURLConnection connection = (HttpURLConnection)url.openConnection();
         connection.setRequestMethod("PUT");
         connection.setDoOutput(true);
         connection.setChunkedStreamingMode(fileContents.length);
         OutputStream os = connection.getOutputStream();
         IO.copy(new ByteArrayInputStream(fileContents), os);
-        os.close();        
+        os.close();
         assertTrue(isSuccessfulCode(connection.getResponseCode()));
         connection.disconnect();
-        
+
         // 2. download
         connection = (HttpURLConnection)url.openConnection();
         InputStream is = connection.getInputStream();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         IO.copy(is, baos);
-        is.close();        
+        is.close();
         assertTrue(isSuccessfulCode(connection.getResponseCode()));
         connection.disconnect();
         assertEquals(fileContents.length, baos.size());
-        
+
         // 3. remove
         connection = (HttpURLConnection)url.openConnection();
         connection.setRequestMethod("DELETE");
         is = connection.getInputStream();
         is.close();
         assertTrue(isSuccessfulCode(connection.getResponseCode()));
-	}
-	
+    }
+
     private boolean isSuccessfulCode(int responseCode) {
-		return responseCode >= 200 && responseCode < 300; // 2xx => successful
-	}
+        return responseCode >= 200 && responseCode < 300; // 2xx => successful
+    }
 }

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateCallback.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateCallback.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateCallback.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateCallback.java Sat Aug 11 22:27:21 2007
@@ -17,9 +17,10 @@
 
 package org.apache.activemq.jaas;
 
-import javax.security.auth.callback.Callback;
 import java.security.cert.X509Certificate;
 
+import javax.security.auth.callback.Callback;
+
 /**
  * A Callback for SSL certificates.
  * 
@@ -29,7 +30,7 @@
  *
  */
 public class CertificateCallback implements Callback {
-    X509Certificate certificates[] = null;
+    X509Certificate certificates[];
     
     /**
      * Setter for certificate chain.

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateLoginModule.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateLoginModule.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateLoginModule.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/CertificateLoginModule.java Sat Aug 11 22:27:21 2007
@@ -17,10 +17,8 @@
 
 package org.apache.activemq.jaas;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.io.IOException;
+import java.security.Principal;
 import java.security.cert.X509Certificate;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -35,49 +33,45 @@
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * A LoginModule that allows for authentication based on SSL certificates.
+ * Allows for subclasses to define methods used to verify user certificates and
+ * find user groups. Uses CertificateCallbacks to retrieve certificates.
  * 
- * Allows for subclasses to define methods used to verify user certificates and find user groups. 
- * Uses CertificateCallbacks to retrieve certificates.
- *  
  * @author sepandm@gmail.com (Sepand)
- *
  */
 public abstract class CertificateLoginModule implements LoginModule {
-    
+
+    private static final Log LOG = LogFactory.getLog(CertificateLoginModule.class);
+
     private CallbackHandler callbackHandler;
     private Subject subject;
-    
+
     private X509Certificate certificates[];
-    private String username = null;
-    private Set groups = null;
-    
-    private Set principals = new HashSet();
-    
-    private static final Log log = LogFactory.getLog(CertificateLoginModule.class);
+    private String username;
+    private Set groups;
+    private Set<Principal> principals = new HashSet<Principal>();
     private boolean debug;
 
     /**
-     * Overriding to allow for proper initialization.
-     * 
-     * Standard JAAS.
+     * Overriding to allow for proper initialization. Standard JAAS.
      */
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
         this.subject = subject;
         this.callbackHandler = callbackHandler;
-        
-        debug = "true".equalsIgnoreCase((String) options.get("debug"));
-        
+
+        debug = "true".equalsIgnoreCase((String)options.get("debug"));
+
         if (debug) {
-            log.debug("Initialized debug");
+            LOG.debug("Initialized debug");
         }
     }
 
     /**
-     * Overriding to allow for certificate-based login.
-     * 
-     * Standard JAAS.
+     * Overriding to allow for certificate-based login. Standard JAAS.
      */
     public boolean login() throws LoginException {
         Callback[] callbacks = new Callback[1];
@@ -90,31 +84,29 @@
         } catch (UnsupportedCallbackException uce) {
             throw new LoginException(uce.getMessage() + " Unable to obtain client certificates.");
         }
-        certificates = ((CertificateCallback) callbacks[0]).getCertificates();
-        
+        certificates = ((CertificateCallback)callbacks[0]).getCertificates();
+
         username = getUserNameForCertificates(certificates);
-        if ( username == null )
-            throw new FailedLoginException("No user for client certificate: "
-                + getDistinguishedName(certificates));
+        if (username == null) {
+            throw new FailedLoginException("No user for client certificate: " + getDistinguishedName(certificates));
+        }
 
         groups = getUserGroups(username);
-        
+
         if (debug) {
-            log.debug("Certificate for user: " + username);
+            LOG.debug("Certificate for user: " + username);
         }
         return true;
     }
 
     /**
-     * Overriding to complete login process.
-     * 
-     * Standard JAAS.
+     * Overriding to complete login process. Standard JAAS.
      */
     public boolean commit() throws LoginException {
         principals.add(new UserPrincipal(username));
 
         String currentGroup = null;
-        for (Iterator iter = groups.iterator(); iter.hasNext(); ) {
+        for (Iterator iter = groups.iterator(); iter.hasNext();) {
             currentGroup = (String)iter.next();
             principals.add(new GroupPrincipal(currentGroup));
         }
@@ -124,7 +116,7 @@
         clear();
 
         if (debug) {
-            log.debug("commit");
+            LOG.debug("commit");
         }
         return true;
     }
@@ -136,7 +128,7 @@
         clear();
 
         if (debug) {
-            log.debug("abort");
+            LOG.debug("abort");
         }
         return true;
     }
@@ -149,11 +141,11 @@
         principals.clear();
 
         if (debug) {
-            log.debug("logout");
+            LOG.debug("logout");
         }
         return true;
     }
-    
+
     /**
      * Helper method.
      */
@@ -161,25 +153,23 @@
         groups.clear();
         certificates = null;
     }
-    
+
     /**
-     * Should return a unique name corresponding to the certificates given.
+     * Should return a unique name corresponding to the certificates given. The
+     * name returned will be used to look up access levels as well as group
+     * associations.
      * 
-     * The name returned will be used to look up access levels as well as
-     *      group associations.
-     *      
      * @param dn The distinguished name.
      * @return The unique name if the certificate is recognized, null otherwise.
      */
     protected abstract String getUserNameForCertificates(final X509Certificate[] certs) throws LoginException;
-    
+
     /**
-     * Should return a set of the groups this user belongs to.
-     * 
-     * The groups returned will be added to the user's credentials.
+     * Should return a set of the groups this user belongs to. The groups
+     * returned will be added to the user's credentials.
      * 
      * @param username The username of the client. This is the same name that
-     *      getUserNameForDn returned for the user's DN.
+     *                getUserNameForDn returned for the user's DN.
      * @return A Set of the names of the groups this user belongs to.
      */
     protected abstract Set getUserGroups(final String username) throws LoginException;

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/GroupPrincipal.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/GroupPrincipal.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/GroupPrincipal.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/GroupPrincipal.java Sat Aug 11 22:27:21 2007
@@ -18,7 +18,6 @@
 
 import java.security.Principal;
 
-
 /**
  * @version $Rev: $ $Date: $
  */
@@ -28,7 +27,9 @@
     private transient int hash;
 
     public GroupPrincipal(String name) {
-        if (name == null) throw new IllegalArgumentException("name cannot be null");
+        if (name == null) {
+            throw new IllegalArgumentException("name cannot be null");
+        }
         this.name = name;
     }
 
@@ -37,12 +38,18 @@
     }
 
     public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        final GroupPrincipal that = (GroupPrincipal) o;
-
-        if (!name.equals(that.name)) return false;
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        final GroupPrincipal that = (GroupPrincipal)o;
+
+        if (!name.equals(that.name)) {
+            return false;
+        }
 
         return true;
     }

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JaasCertificateCallbackHandler.java Sat Aug 11 22:27:21 2007
@@ -17,27 +17,22 @@
 
 package org.apache.activemq.jaas;
 
+import java.io.IOException;
+import java.security.cert.X509Certificate;
 
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
 
-import java.io.IOException;
-import java.security.cert.X509Certificate;
-
 /**
- * A Standard JAAS callback handler for SSL certificate requests.
- * 
- * Will only handle callbacks of type CertificateCallback.
+ * A Standard JAAS callback handler for SSL certificate requests. Will only
+ * handle callbacks of type CertificateCallback.
  * 
  * @author sepandm@gmail.com (Sepand)
- *
  */
 public class JaasCertificateCallbackHandler implements CallbackHandler {
     final X509Certificate certificates[];
-    
+
     /**
      * Basic constructor.
      * 
@@ -46,22 +41,23 @@
     public JaasCertificateCallbackHandler(X509Certificate certs[]) {
         certificates = certs;
     }
-    
+
     /**
      * Overriding handle method to handle certificates.
      * 
      * @param callbacks The callbacks requested.
      * @throws IOException
-     * @throws UnsupportedCallbackException Thrown if an unkown Callback type is encountered.
+     * @throws UnsupportedCallbackException Thrown if an unkown Callback type is
+     *                 encountered.
      */
     public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
             Callback callback = callbacks[i];
             if (callback instanceof CertificateCallback) {
-                CertificateCallback certCallback = (CertificateCallback) callback;
-                
+                CertificateCallback certCallback = (CertificateCallback)callback;
+
                 certCallback.setCertificates(certificates);
-                
+
             } else {
                 throw new UnsupportedCallbackException(callback);
             }

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JassCredentialCallbackHandler.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JassCredentialCallbackHandler.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JassCredentialCallbackHandler.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/JassCredentialCallbackHandler.java Sat Aug 11 22:27:21 2007
@@ -16,13 +16,13 @@
  */
 package org.apache.activemq.jaas;
 
+import java.io.IOException;
+
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
-import java.io.IOException;
-
 
 /**
  * A JASS username password CallbackHandler.
@@ -41,19 +41,17 @@
         for (int i = 0; i < callbacks.length; i++) {
             Callback callback = callbacks[i];
             if (callback instanceof PasswordCallback) {
-                PasswordCallback passwordCallback = (PasswordCallback) callback;
+                PasswordCallback passwordCallback = (PasswordCallback)callback;
                 if (password == null) {
                     passwordCallback.setPassword(null);
-                }
-                else {
+                } else {
                     passwordCallback.setPassword(password.toCharArray());
                 }
             } else if (callback instanceof NameCallback) {
-                NameCallback nameCallback = (NameCallback) callback;
+                NameCallback nameCallback = (NameCallback)callback;
                 if (username == null) {
                     nameCallback.setName(null);
-                }
-                else {
+                } else {
                     nameCallback.setName(username);
                 }
             }

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java Sat Aug 11 22:27:21 2007
@@ -17,6 +17,7 @@
 package org.apache.activemq.jaas;
 
 import java.io.IOException;
+import java.security.Principal;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -24,6 +25,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+
 import javax.naming.AuthenticationException;
 import javax.naming.CommunicationException;
 import javax.naming.Context;
@@ -43,24 +45,18 @@
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.LoginException;
 import javax.security.auth.login.FailedLoginException;
+import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-
 /**
  * @version $Rev: $ $Date: $
  */
 public class LDAPLoginModule implements LoginModule {
 
-    private static Log log = LogFactory.getLog(LDAPLoginModule.class);
-
-    private Subject subject;
-    private CallbackHandler handler;
-
     private static final String INITIAL_CONTEXT_FACTORY = "initialContextFactory";
     private static final String CONNECTION_URL = "connectionURL";
     private static final String CONNECTION_USERNAME = "connectionUsername";
@@ -76,6 +72,12 @@
     private static final String ROLE_SEARCH_SUBTREE = "roleSearchSubtree";
     private static final String USER_ROLE_NAME = "userRoleName";
 
+    private static Log log = LogFactory.getLog(LDAPLoginModule.class);
+
+    protected DirContext context;
+
+    private Subject subject;
+    private CallbackHandler handler;
     private String initialContextFactory;
     private String connectionURL;
     private String connectionUsername;
@@ -86,36 +88,30 @@
     private String roleBase;
     private String roleName;
     private String userRoleName;
-
     private String username;
-
-    protected DirContext context = null;
-
     private MessageFormat userSearchMatchingFormat;
     private MessageFormat roleSearchMatchingFormat;
-
-    private boolean userSearchSubtreeBool = false;
-    private boolean roleSearchSubtreeBool = false;
-
-    Set groups = new HashSet();
+    private boolean userSearchSubtreeBool;
+    private boolean roleSearchSubtreeBool;
+    private Set<GroupPrincipal> groups = new HashSet<GroupPrincipal>();
 
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
         this.subject = subject;
         this.handler = callbackHandler;
-        initialContextFactory = (String) options.get(INITIAL_CONTEXT_FACTORY);
-        connectionURL = (String) options.get(CONNECTION_URL);
-        connectionUsername = (String) options.get(CONNECTION_USERNAME);
-        connectionPassword = (String) options.get(CONNECTION_PASSWORD);
-        connectionProtocol = (String) options.get(CONNECTION_PROTOCOL);
-        authentication = (String) options.get(AUTHENTICATION);
-        userBase = (String) options.get(USER_BASE);
-        String userSearchMatching = (String) options.get(USER_SEARCH_MATCHING);
-        String userSearchSubtree = (String) options.get(USER_SEARCH_SUBTREE);
-        roleBase = (String) options.get(ROLE_BASE);
-        roleName = (String) options.get(ROLE_NAME);
-        String roleSearchMatching = (String) options.get(ROLE_SEARCH_MATCHING);
-        String roleSearchSubtree = (String) options.get(ROLE_SEARCH_SUBTREE);
-        userRoleName = (String) options.get(USER_ROLE_NAME);
+        initialContextFactory = (String)options.get(INITIAL_CONTEXT_FACTORY);
+        connectionURL = (String)options.get(CONNECTION_URL);
+        connectionUsername = (String)options.get(CONNECTION_USERNAME);
+        connectionPassword = (String)options.get(CONNECTION_PASSWORD);
+        connectionProtocol = (String)options.get(CONNECTION_PROTOCOL);
+        authentication = (String)options.get(AUTHENTICATION);
+        userBase = (String)options.get(USER_BASE);
+        String userSearchMatching = (String)options.get(USER_SEARCH_MATCHING);
+        String userSearchSubtree = (String)options.get(USER_SEARCH_SUBTREE);
+        roleBase = (String)options.get(ROLE_BASE);
+        roleName = (String)options.get(ROLE_NAME);
+        String roleSearchMatching = (String)options.get(ROLE_SEARCH_MATCHING);
+        String roleSearchSubtree = (String)options.get(ROLE_SEARCH_SUBTREE);
+        userRoleName = (String)options.get(USER_ROLE_NAME);
         userSearchMatchingFormat = new MessageFormat(userSearchMatching);
         roleSearchMatchingFormat = new MessageFormat(roleSearchMatching);
         userSearchSubtreeBool = Boolean.valueOf(userSearchSubtree).booleanValue();
@@ -130,12 +126,12 @@
         try {
             handler.handle(callbacks);
         } catch (IOException ioe) {
-            throw (LoginException) new LoginException().initCause(ioe);
+            throw (LoginException)new LoginException().initCause(ioe);
         } catch (UnsupportedCallbackException uce) {
-            throw (LoginException) new LoginException().initCause(uce);
+            throw (LoginException)new LoginException().initCause(uce);
         }
-        username = ((NameCallback) callbacks[0]).getName();
-        String password = new String(((PasswordCallback) callbacks[1]).getPassword());
+        username = ((NameCallback)callbacks[0]).getName();
+        String password = new String(((PasswordCallback)callbacks[1]).getPassword());
 
         if (username == null || "".equals(username) || password == null || "".equals(password)) {
             return false;
@@ -143,13 +139,13 @@
 
         try {
             boolean result = authenticate(username, password);
-            if(!result) {
+            if (!result) {
                 throw new FailedLoginException();
             } else {
                 return true;
             }
         } catch (Exception e) {
-            throw (LoginException) new LoginException("LDAP Error").initCause(e);
+            throw (LoginException)new LoginException("LDAP Error").initCause(e);
         }
     }
 
@@ -159,9 +155,9 @@
     }
 
     public boolean commit() throws LoginException {
-        Set principals = subject.getPrincipals();
+        Set<Principal> principals = subject.getPrincipals();
         principals.add(new UserPrincipal(username));
-        Iterator iter = groups.iterator();
+        Iterator<GroupPrincipal> iter = groups.iterator();
         while (iter.hasNext()) {
             principals.add(iter.next());
         }
@@ -188,7 +184,9 @@
 
         try {
 
-            String filter = userSearchMatchingFormat.format(new String[]{username});
+            String filter = userSearchMatchingFormat.format(new String[] {
+                username
+            });
             SearchControls constraints = new SearchControls();
             if (userSearchSubtreeBool) {
                 constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
@@ -196,8 +194,8 @@
                 constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE);
             }
 
-            //setup attributes
-            ArrayList list = new ArrayList();
+            // setup attributes
+            ArrayList<String> list = new ArrayList<String>();
             if (userRoleName != null) {
                 list.add(userRoleName);
             }
@@ -205,17 +203,16 @@
             list.toArray(attribs);
             constraints.setReturningAttributes(attribs);
 
-
             NamingEnumeration results = context.search(userBase, filter, constraints);
 
             if (results == null || !results.hasMore()) {
                 return false;
             }
 
-            SearchResult result = (SearchResult) results.next();
+            SearchResult result = (SearchResult)results.next();
 
             if (results.hasMore()) {
-                //ignore for now
+                // ignore for now
             }
             NameParser parser = context.getNameParser("");
             Name contextName = parser.parse(context.getNameInNamespace());
@@ -229,17 +226,17 @@
             if (attrs == null) {
                 return false;
             }
-            ArrayList roles = null;
+            ArrayList<String> roles = null;
             if (userRoleName != null) {
                 roles = addAttributeValues(userRoleName, attrs, roles);
             }
 
-            //check the credentials by binding to server
+            // check the credentials by binding to server
             if (bindUser(context, dn, password)) {
-                //if authenticated add more roles
+                // if authenticated add more roles
                 roles = getRoles(context, dn, username, roles);
                 for (int i = 0; i < roles.size(); i++) {
-                    groups.add(new GroupPrincipal((String) roles.get(i)));
+                    groups.add(new GroupPrincipal(roles.get(i)));
                 }
             } else {
                 return false;
@@ -253,19 +250,20 @@
             return false;
         }
 
-
         return true;
     }
 
-    protected ArrayList getRoles(DirContext context, String dn, String username, ArrayList currentRoles) throws NamingException {
-        ArrayList list = currentRoles;
+    protected ArrayList<String> getRoles(DirContext context, String dn, String username, ArrayList<String> currentRoles) throws NamingException {
+        ArrayList<String> list = currentRoles;
         if (list == null) {
-            list = new ArrayList();
+            list = new ArrayList<String>();
         }
         if (roleName == null || "".equals(roleName)) {
             return list;
         }
-        String filter = roleSearchMatchingFormat.format(new String[]{doRFC2254Encoding(dn), username});
+        String filter = roleSearchMatchingFormat.format(new String[] {
+            doRFC2254Encoding(dn), username
+        });
 
         SearchControls constraints = new SearchControls();
         if (roleSearchSubtreeBool) {
@@ -273,10 +271,9 @@
         } else {
             constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE);
         }
-        NamingEnumeration results =
-                context.search(roleBase, filter, constraints);
+        NamingEnumeration results = context.search(roleBase, filter, constraints);
         while (results.hasMore()) {
-            SearchResult result = (SearchResult) results.next();
+            SearchResult result = (SearchResult)results.next();
             Attributes attrs = result.getAttributes();
             if (attrs == null) {
                 continue;
@@ -287,30 +284,29 @@
 
     }
 
-
     protected String doRFC2254Encoding(String inputString) {
         StringBuffer buf = new StringBuffer(inputString.length());
         for (int i = 0; i < inputString.length(); i++) {
             char c = inputString.charAt(i);
             switch (c) {
-                case '\\':
-                    buf.append("\\5c");
-                    break;
-                case '*':
-                    buf.append("\\2a");
-                    break;
-                case '(':
-                    buf.append("\\28");
-                    break;
-                case ')':
-                    buf.append("\\29");
-                    break;
-                case '\0':
-                    buf.append("\\00");
-                    break;
-                default:
-                    buf.append(c);
-                    break;
+            case '\\':
+                buf.append("\\5c");
+                break;
+            case '*':
+                buf.append("\\2a");
+                break;
+            case '(':
+                buf.append("\\28");
+                break;
+            case ')':
+                buf.append("\\29");
+                break;
+            case '\0':
+                buf.append("\\00");
+                break;
+            default:
+                buf.append(c);
+                break;
             }
         }
         return buf.toString();
@@ -330,15 +326,13 @@
         }
 
         if (connectionUsername != null) {
-            context.addToEnvironment(Context.SECURITY_PRINCIPAL,
-                    connectionUsername);
+            context.addToEnvironment(Context.SECURITY_PRINCIPAL, connectionUsername);
         } else {
             context.removeFromEnvironment(Context.SECURITY_PRINCIPAL);
         }
 
         if (connectionPassword != null) {
-            context.addToEnvironment(Context.SECURITY_CREDENTIALS,
-                    connectionPassword);
+            context.addToEnvironment(Context.SECURITY_CREDENTIALS, connectionPassword);
         } else {
             context.removeFromEnvironment(Context.SECURITY_CREDENTIALS);
         }
@@ -346,23 +340,21 @@
         return isValid;
     }
 
-    private ArrayList addAttributeValues(String attrId, Attributes attrs, ArrayList values)
-            throws NamingException
-    {
+    private ArrayList<String> addAttributeValues(String attrId, Attributes attrs, ArrayList<String> values) throws NamingException {
 
         if (attrId == null || attrs == null) {
             return values;
         }
         if (values == null) {
-            values = new ArrayList();
+            values = new ArrayList<String>();
         }
         Attribute attr = attrs.get(attrId);
         if (attr == null) {
-            return (values);
+            return values;
         }
         NamingEnumeration e = attr.getAll();
         while (e.hasMore()) {
-            String value = (String) e.next();
+            String value = (String)e.next();
             values.add(value);
         }
         return values;
@@ -374,7 +366,7 @@
         }
 
         try {
-            Hashtable env = new Hashtable();
+            Hashtable<String, String> env = new Hashtable<String, String>();
             env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
             if (connectionUsername != null || !"".equals(connectionUsername)) {
                 env.put(Context.SECURITY_PRINCIPAL, connectionUsername);

Modified: activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java (original)
+++ activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java Sat Aug 11 22:27:21 2007
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.security.Principal;
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.Map;
@@ -30,14 +31,13 @@
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.LoginException;
 import javax.security.auth.login.FailedLoginException;
+import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-
 /**
  * @version $Rev: $ $Date: $
  */
@@ -46,7 +46,7 @@
     private static final String USER_FILE = "org.apache.activemq.jaas.properties.user";
     private static final String GROUP_FILE = "org.apache.activemq.jaas.properties.group";
 
-    private static final Log log = LogFactory.getLog(PropertiesLoginModule.class);
+    private static final Log LOG = LogFactory.getLog(PropertiesLoginModule.class);
 
     private Subject subject;
     private CallbackHandler callbackHandler;
@@ -57,32 +57,32 @@
     private Properties users = new Properties();
     private Properties groups = new Properties();
     private String user;
-    private Set principals = new HashSet();
+    private Set<Principal> principals = new HashSet<Principal>();
     private File baseDir;
 
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
         this.subject = subject;
         this.callbackHandler = callbackHandler;
 
-        if( System.getProperty("java.security.auth.login.config")!=null ) {
-            baseDir=new File(System.getProperty("java.security.auth.login.config")).getParentFile();
+        if (System.getProperty("java.security.auth.login.config") != null) {
+            baseDir = new File(System.getProperty("java.security.auth.login.config")).getParentFile();
         } else {
             baseDir = new File(".");
         }
 
-        debug = "true".equalsIgnoreCase((String) options.get("debug"));
-        usersFile = (String) options.get(USER_FILE)+"";
-        groupsFile = (String) options.get(GROUP_FILE)+"";
+        debug = "true".equalsIgnoreCase((String)options.get("debug"));
+        usersFile = (String)options.get(USER_FILE) + "";
+        groupsFile = (String)options.get(GROUP_FILE) + "";
 
         if (debug) {
-            log.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile+" basedir="+baseDir);
+            LOG.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile + " basedir=" + baseDir);
         }
     }
 
     public boolean login() throws LoginException {
-        File f = new File(baseDir,usersFile);
+        File f = new File(baseDir, usersFile);
         try {
-        	java.io.FileInputStream in = new java.io.FileInputStream(f);
+            java.io.FileInputStream in = new java.io.FileInputStream(f);
             users.load(in);
             in.close();
         } catch (IOException ioe) {
@@ -90,7 +90,7 @@
         }
         f = new File(baseDir, groupsFile);
         try {
-        	java.io.FileInputStream in = new java.io.FileInputStream(f);
+            java.io.FileInputStream in = new java.io.FileInputStream(f);
             groups.load(in);
             in.close();
         } catch (IOException ioe) {
@@ -108,19 +108,23 @@
         } catch (UnsupportedCallbackException uce) {
             throw new LoginException(uce.getMessage() + " not available to obtain information from user");
         }
-        user = ((NameCallback) callbacks[0]).getName();
-        char[] tmpPassword = ((PasswordCallback) callbacks[1]).getPassword();
-        if (tmpPassword == null) tmpPassword = new char[0];
-
+        user = ((NameCallback)callbacks[0]).getName();
+        char[] tmpPassword = ((PasswordCallback)callbacks[1]).getPassword();
+        if (tmpPassword == null) {
+            tmpPassword = new char[0];
+        }
         String password = users.getProperty(user);
 
-        if (password == null) throw new FailedLoginException("User does exist");
-        if (!password.equals(new String(tmpPassword))) throw new FailedLoginException("Password does not match");
-
+        if (password == null) {
+            throw new FailedLoginException("User does exist");
+        }
+        if (!password.equals(new String(tmpPassword))) {
+            throw new FailedLoginException("Password does not match");
+        }
         users.clear();
 
         if (debug) {
-            log.debug("login " + user);
+            LOG.debug("login " + user);
         }
         return true;
     }
@@ -129,8 +133,8 @@
         principals.add(new UserPrincipal(user));
 
         for (Enumeration enumeration = groups.keys(); enumeration.hasMoreElements();) {
-            String name = (String) enumeration.nextElement();
-            String[] userList = ((String) groups.getProperty(name) + "").split(",");
+            String name = (String)enumeration.nextElement();
+            String[] userList = ((String)groups.getProperty(name) + "").split(",");
             for (int i = 0; i < userList.length; i++) {
                 if (user.equals(userList[i])) {
                     principals.add(new GroupPrincipal(name));
@@ -144,7 +148,7 @@
         clear();
 
         if (debug) {
-            log.debug("commit");
+            LOG.debug("commit");
         }
         return true;
     }
@@ -153,7 +157,7 @@
         clear();
 
         if (debug) {
-            log.debug("abort");
+            LOG.debug("abort");
         }
         return true;
     }
@@ -163,7 +167,7 @@
         principals.clear();
 
         if (debug) {
-            log.debug("logout");
+            LOG.debug("logout");
         }
         return true;
     }



Mime
View raw message