[jboss-svn-commits] JBL Code SVN: r10373 - in labs/jbossesb/branches/JBESB_4_0_MP1: product/ftp and 23 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Mar 20 19:54:42 EDT 2007
Author: bill.burke at jboss.com
Date: 2007-03-20 19:54:42 -0400 (Tue, 20 Mar 2007)
New Revision: 10373
Added:
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/build.xml
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/backport-util-concurrent-2.2.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/log4j-1.2.13.ignore
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/mina-core-1.0.2.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/mina-filter-ssl-1.0.2.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/slf4j-api-1.3.0.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/slf4j-log4j12-1.3.0.jar
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServer.java
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServerMBean.java
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/PathSubstitutionPropertiesConfiguration.java
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/VirtualPropertiesUserManager.java
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/META-INF/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/META-INF/jboss-service.xml
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/appendcp.bat
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.bat
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.sh
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/log4j.properties
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/.keystore
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/README.txt
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.properties
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.xml
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/ftp-db.sql
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/home/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/home/README.txt
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/README.txt
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/log.gen
labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/user.gen
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/deployment.xml
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/esb-jbm-service.xml
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyAction.java
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/ftp/
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/FtpUnitTestCase.java
Removed:
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyJMSListenerAction.java
Modified:
labs/jbossesb/branches/JBESB_4_0_MP1/product/build-distr.xml
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/build.xml
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple-scoped/META-INF/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple/META-INF/jboss-esb.xml
Log:
add FTP server to MP1 as well as a qa/junit test for it that uses the JBoss TestCase code.
Also added the FTP server to the distribution
Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/build-distr.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/build-distr.xml 2007-03-20 23:51:55 UTC (rev 10372)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/build-distr.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -40,12 +40,21 @@
</copy>
</target>
- <target name="server.dist" depends="build.sar, unpack.server.zip">
+ <target name="ftp-server">
+ <ant antfile="build.xml" dir="ftp"/>
+ </target>
+
+ <target name="server.dist" depends="build.sar, unpack.server.zip, ftp-server">
<copy todir="${esbserver.dist.dir}/server/default/deploy/jbossesb.sar">
<fileset dir="${build.dir}/jbossesb.sar">
<include name="**/*"/>
</fileset>
</copy>
+ <copy todir="${esbserver.dist.dir}/server/default/deploy">
+ <fileset dir="ftp/build">
+ <include name="ftp-server.sar/**/*"/>
+ </fileset>
+ </copy>
</target>
<target name="unpack.server.zip">
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/build.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/build.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+
+<!-- ======================================================================= -->
+<!-- JBoss build file -->
+<!-- ======================================================================= -->
+
+<project name="JBoss" default="sar" basedir=".">
+
+ <property name="src.dir" value="${basedir}/src/main/java"/>
+ <property name="resource.dir" value="${basedir}/src/main/resources"/>
+ <property name="build.dir" value="${basedir}/build"/>
+ <property name="build.classes.dir" value="${build.dir}/classes"/>
+
+ <!-- Build classpath -->
+ <path id="classpath">
+ <fileset dir="lib">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="../lib/ext">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <property name="build.classpath" refid="classpath"/>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the build directory -->
+ <!-- =================================================================== -->
+ <target name="prepare">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.classes.dir}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Compiles the source code -->
+ <!-- =================================================================== -->
+ <target name="compile" depends="prepare">
+ <javac srcdir="${src.dir}"
+ destdir="${build.classes.dir}"
+ debug="on"
+ deprecation="on"
+ optimize="off"
+ includes="**">
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <target name="sar" depends="compile">
+ <mkdir dir="${build.dir}/ftp-server.sar"/>
+ <copy todir="${build.dir}/ftp-server.sar">
+ <fileset dir="${build.classes.dir}">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir=".">
+ <include name="lib/*.jar"/>
+ </fileset>
+ <fileset dir=".">
+ <include name="lib/*.ignore"/>
+ </fileset>
+ <fileset dir="${resource.dir}">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+
+
+</project>
+
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/backport-util-concurrent-2.2.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/backport-util-concurrent-2.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/log4j-1.2.13.ignore
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/log4j-1.2.13.ignore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/mina-core-1.0.2.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/mina-core-1.0.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/mina-filter-ssl-1.0.2.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/mina-filter-ssl-1.0.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/slf4j-api-1.3.0.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/slf4j-api-1.3.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/slf4j-log4j12-1.3.0.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/lib/slf4j-log4j12-1.3.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServer.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServer.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServer.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ftp;
+
+import org.jboss.system.ServiceMBeanSupport;
+import org.apache.ftpserver.interfaces.FtpServerContext;
+import org.apache.ftpserver.ConfigurableFtpServerContext;
+import org.apache.ftpserver.FtpServer;
+import org.apache.ftpserver.ftplet.Configuration;
+
+import java.net.URL;
+import java.net.URI;
+import java.io.InputStream;
+import java.io.File;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class FTPServer extends ServiceMBeanSupport implements FTPServerMBean
+{
+ FtpServer server;
+
+ @Override
+ protected void startService() throws Exception
+ {
+ URL properties = Thread.currentThread().getContextClassLoader().getResource("res/conf/ftpd.properties");
+ PathSubstitutionPropertiesConfiguration config = new PathSubstitutionPropertiesConfiguration(properties.openStream());
+
+ URI uri = properties.toURI();
+ File file = new File(uri);
+ String path = file.getParentFile().getParentFile().getParentFile().toString();
+ if (!path.endsWith("/")) path += "/";
+
+ config.setBasePath(path);
+
+ config.setProperty("config.user-manager.class", org.jboss.ftp.VirtualPropertiesUserManager.class.getName());
+ config.setProperty("config.user-manager.admin-name", config.getString("config.user-manager.admin-name", "admin"));
+ config.setProperty("config.user-manager.prop-file", path + "res/user.gen");
+ log.info("prop-file path: " + path + "res/user.gen");
+ config.setProperty("config.user-manager.encrypt-passwords", config.getString("config.user-manager.encrypt-passwords", "true"));
+ config.setProperty("config.user-manager.base-path", path);
+
+ FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config);
+ server = new FtpServer(ftpConfig);
+ server.start();
+ super.startService();
+ }
+
+
+ @Override
+ protected void stopService() throws Exception
+ {
+ server.stop();
+ super.stopService(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServerMBean.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServerMBean.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/FTPServerMBean.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ftp;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface FTPServerMBean extends ServiceMBean
+{
+}
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/PathSubstitutionPropertiesConfiguration.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/PathSubstitutionPropertiesConfiguration.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/PathSubstitutionPropertiesConfiguration.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,109 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ftp;
+
+import org.apache.ftpserver.config.PropertiesConfiguration;
+import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.Configuration;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * Hack to replace all ./ in configuration files so that we can manage the server easily
+ * yet embed it anywhere
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class PathSubstitutionPropertiesConfiguration extends PropertiesConfiguration
+{
+ private String basePath;
+
+
+ public PathSubstitutionPropertiesConfiguration()
+ {
+ }
+
+ public PathSubstitutionPropertiesConfiguration(InputStream in)
+ throws IOException
+ {
+ super(in);
+ }
+
+ public PathSubstitutionPropertiesConfiguration(Properties prop)
+ {
+ super(prop);
+ }
+
+
+ public String getBasePath()
+ {
+ return basePath;
+ }
+
+ public void setBasePath(String basePath)
+ {
+ this.basePath = basePath;
+ }
+
+ public void setProperty(String name, String value)
+ {
+ prop.setProperty(name, value);
+ }
+
+
+ @Override
+ public Configuration subset(String param)
+ {
+ PathSubstitutionPropertiesConfiguration subConfig = new PathSubstitutionPropertiesConfiguration();
+ subConfig.setBasePath(basePath);
+ subConfig.prop = prop;
+ subConfig.prefix = prefix + param + '.';
+ return subConfig;
+ }
+
+ @Override
+ public String getString(String param, String defaultVal)
+ {
+ String rtn = super.getString(param, defaultVal);
+ if (rtn == null) return null;
+ if (rtn.startsWith("./"))
+ {
+ rtn = basePath + rtn.substring(2);
+ }
+ return rtn;
+ }
+
+ @Override
+ public String getString(String param) throws FtpException
+ {
+ String rtn = super.getString(param);
+ if (rtn == null) return null;
+ if (rtn.startsWith("./"))
+ {
+ rtn = basePath + rtn.substring(2);
+ }
+ return rtn;
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/VirtualPropertiesUserManager.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/VirtualPropertiesUserManager.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/java/org/jboss/ftp/VirtualPropertiesUserManager.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ftp;
+
+import org.apache.ftpserver.usermanager.PropertiesUserManager;
+import org.apache.ftpserver.usermanager.BaseUser;
+import org.apache.ftpserver.ftplet.User;
+
+import java.io.File;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class VirtualPropertiesUserManager extends PropertiesUserManager
+{
+ private String basePath;
+
+
+ public VirtualPropertiesUserManager()
+ {
+ }
+
+
+ public String getBasePath()
+ {
+ return basePath;
+ }
+
+ public void setBasePath(String basePath)
+ {
+ this.basePath = basePath;
+ }
+
+
+ @Override
+ public void setPropFile(File propFile)
+ {
+ super.setPropFile(propFile);
+ }
+
+ @Override
+ public synchronized User getUserByName(String userName)
+ {
+ BaseUser user = (BaseUser)super.getUserByName(userName);
+ String home = user.getHomeDirectory();
+ if (home == null) return user;
+
+ user.setHomeDirectory(basePath + home.substring(2));
+ return user;
+ }
+}
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/META-INF/jboss-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/META-INF/jboss-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/META-INF/jboss-service.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean code="org.jboss.ftp.FTPServer"
+ name="jboss.esb:service=FTPServer">
+ </mbean>
+ <loader-repository>
+ org.jboss.soa.esb:loader=ftpserver.sar
+ <loader-repository-config>
+ java2ParentDelegaton=false
+ </loader-repository-config>
+ </loader-repository>
+</server>
\ No newline at end of file
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/appendcp.bat
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/appendcp.bat (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/appendcp.bat 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,22 @@
+REM Licensed to the Apache Software Foundation (ASF) under one
+REM or more contributor license agreements. See the NOTICE file
+REM distributed with this work for additional information
+REM regarding copyright ownership. The ASF licenses this file
+REM to you under the Apache License, Version 2.0 (the
+REM "License"); you may not use this file except in compliance
+REM with the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing,
+REM software distributed under the License is distributed on an
+REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+REM KIND, either express or implied. See the License for the
+REM specific language governing permissions and limitations
+REM under the License.
+
+If %OS%'==Windows_NT' Set NTSwitch=/F "Tokens=*"
+If %OS%'==WINNT' Set NTSwitch=/F "Tokens=*"
+For %NTSwitch% %%V In (%1) Do set FTPD_CLASSPATH=%FTPD_CLASSPATH%;%%V
+
+
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.bat
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.bat (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.bat 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,39 @@
+ at echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one
+REM or more contributor license agreements. See the NOTICE file
+REM distributed with this work for additional information
+REM regarding copyright ownership. The ASF licenses this file
+REM to you under the Apache License, Version 2.0 (the
+REM "License"); you may not use this file except in compliance
+REM with the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing,
+REM software distributed under the License is distributed on an
+REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+REM KIND, either express or implied. See the License for the
+REM specific language governing permissions and limitations
+REM under the License.
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+rem ----- use the location of this script to infer $FTPD_HOME -------
+if NOT "%OS%"=="Windows_NT" set DEFAULT_FTPD_HOME=..
+if "%OS%"=="Windows_NT" set DEFAULT_FTPD_HOME=%~dp0/..
+if "%OS%"=="WINNT" set DEFAULT_FTPD_HOME=%~dp0/..
+if "%FTPD_HOME%"=="" set FTPD_HOME=%DEFAULT_FTPD_HOME%
+
+rem ----- Create CLASSPATH --------------------------------------------
+set FTPD_CLASSPATH=%CLASSPATH%;%FTPD_HOME%\lib\log4j-1.2.13.ignore;
+cd /d "%FTPD_HOME%\lib"
+for %%i in ("*.jar") do call "%FTPD_HOME%\bin\appendcp.bat" "%FTPD_HOME%\lib\%%i"
+cd /d %FTPD_HOME%
+
+
+rem ----- call java.. ---------------------------------------------------
+set MAIN_CLASS=org.apache.ftpserver.gui.ServerFrame
+set JAVA_CMD=%JAVA_HOME%\bin\java
+"%JAVA_CMD%" -classpath "%FTPD_CLASSPATH%" %MAIN_CLASS% %*
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.sh
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.sh (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/bin/ftpd_ui.sh 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,136 @@
+#!/bin/sh
+
+# 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.
+
+#
+# OS specific support. $var _must_ be set to either true or false.
+#
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+ fi
+ ;;
+esac
+
+#
+# Get the FTPD_HOME variable
+#
+if [ -z "$FTPD_HOME" ] ; then
+ # use the location of this script to infer $FTPD_HOME
+ whoami=`basename $0`
+ whereami=`echo $0 | sed -e "s#^[^/]#\`pwd\`/&#"`
+ whereami=`dirname $whereami`
+
+ # Resolve any symlinks of the now absolute path, $whereami
+ realpath_listing=`ls -l $whereami/$whoami`
+ case "$realpath_listing" in
+ *-\>\ /*)
+ realpath=`echo $realpath_listing | sed -e "s#^.*-> ##"`
+ ;;
+ *-\>*)
+ realpath=`echo $realpath_listing | sed -e "s#^.*-> #$whereami/#"`
+ ;;
+ *)
+ realpath=$whereami/$whoami
+ ;;
+ esac
+ FTPD_HOME=`dirname "$realpath"`/..
+fi
+
+
+#
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+#
+if $cygwin ; then
+ [ -n "$FTPD_HOME" ] &&
+ FTPD_HOME=`cygpath --unix "$FTPD_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+
+#
+# Get the Java command
+#
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=`which java 2> /dev/null `
+ if [ -z "$JAVACMD" ] ; then
+ JAVACMD=java
+ fi
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+
+#
+# Get the path separator
+#
+if [ "$cygwin" = "true" ] ; then
+ S=';'
+else
+ S=':'
+fi
+
+
+#
+# Build classpath
+#
+if [ "$cygwin" = "true" ] ; then
+ FTPD_CLASSPATH=$CLASSPATH$S`cygpath -w $FTPD_HOME/common/classes`$S`cygpath -w $FTPD_HOME/target/classes`
+else
+ FTPD_CLASSPATH=$CLASSPATH$S$FTPD_HOME/common/classes$S$FTPD_HOME/target/classes
+fi
+
+for i in $FTPD_HOME/common/lib/*.jar; do
+ if [ "$cygwin" = "true" ] ; then
+ LIB=`cygpath -w $i`
+ else
+ LIB=$i
+ fi
+
+ FTPD_CLASSPATH=$FTPD_CLASSPATH$S$LIB
+done
+
+
+#
+# Execute command
+#
+CURR_DIR=`pwd`
+cd $FTPD_HOME
+MAIN_CLASS=org.apache.ftpserver.gui.ServerFrame
+"$JAVACMD" -classpath "$FTPD_CLASSPATH" $MAIN_CLASS $@
+RESULT=$?
+cd $CURR_DIR
+exit $RESULT
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/log4j.properties
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/log4j.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/log4j.properties 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +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.
+
+log4j.rootLogger=DEBUG, R
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=./res/log/log.gen
+log4j.appender.R.MaxFileSize=10MB
+log4j.appender.R.MaxBackupIndex=10
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=[%5p] %d %m%n
+
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/.keystore
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/README.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/README.txt (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/README.txt 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,3 @@
+You can find two sample configuration files here. One is a properties
+file based configuration file and the other is a XML file based
+configuration file.
\ No newline at end of file
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.properties
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.properties 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,161 @@
+# 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.
+
+## Properties file based configuration
+
+##-----------------------------------------------------------------------------
+## This is the listener configuration. Additional listeners can be added if required.
+## If you want to support SSL connections, please specify ssl block
+##-----------------------------------------------------------------------------
+#config.listeners.default.class=org.apache.ftpserver.listener.mina.MinaListener
+#config.listeners.default.address=localhost
+#config.listeners.default.port=21
+#config.listeners.default.implicit-ssl=false
+#config.listeners.default.ssl.class=org.apache.ftpserver.ssl.DefaultSsl
+#config.listeners.default.ssl.keystore-file=./res/.keystore
+#config.listeners.default.ssl.keystore-password=password
+#config.listeners.default.ssl.keystore-type=JKS
+#config.listeners.default.ssl.keystore-algorithm=SunX509
+#config.listeners.default.ssl.ssl-protocol=TLS
+#config.listeners.default.ssl.client-authentication=false
+#config.listeners.default.ssl.key-password=password
+
+##------------------------------------------------------------------------------
+## Data connection configuration
+## If you want to use encrypted data connection, please use ssl block.
+##------------------------------------------------------------------------------
+#config.listeners.default.data-connection.class=org.apache.ftpserver.DefaultDataConnectionConfig
+#config.listeners.default.data-connection.idle-time=10
+#config.listeners.default.data-connection.active.enable=true
+#config.listeners.default.data-connection.active.local-address=localhost
+#config.listeners.default.data-connection.active.local-port=20
+#config.listeners.default.data-connection.active.ip-check=false
+#config.listeners.default.data-connection.passive.address=localhost
+#config.listeners.default.data-connection.passive.ports=0
+#config.listeners.default.data-connection.ssl.class=org.apache.ftpserver.ssl.DefaultSsl
+#config.listeners.default.data-connection.ssl.keystore-file=./res/.keystore
+#config.listeners.default.data-connection.ssl.keystore-password=password
+#config.listeners.default.data-connection.ssl.keystore-type=JKS
+#config.listeners.default.data-connection.ssl.keystore-algorithm=SunX509
+#config.listeners.default.data-connection.ssl.ssl-protocol=TLS
+#config.listeners.default.data-connection.ssl.client-authentication=false
+#config.listeners.default.data-connection.ssl.key-password=password
+
+
+##-----------------------------------------------------------------------------
+## Standard users admin and anonymous will be created by default.
+##-----------------------------------------------------------------------------
+#config.create-default-user=true
+
+
+##-----------------------------------------------------------------------------
+## Ftp message configuration block
+##-----------------------------------------------------------------------------
+#config.message.class=org.apache.ftpserver.message.MessageResourceImpl
+#config.message.custom-message-dir=./res
+#config.message.languages=en,zh-tw
+
+
+##-----------------------------------------------------------------------------
+## Connection manager configuration
+##-----------------------------------------------------------------------------
+#config.connection-manager.max-connection=20
+#config.connection-manager.max-login=10
+#config.connection-manager.anonymous-login-enabled=true
+#config.connection-manager.max-anonymous-login=10
+#config.connection-manager.default-idle-time=60
+#config.connection-manager.timeout-poll-inverval=60
+
+
+##-----------------------------------------------------------------------------
+## Command factory configuration
+##-----------------------------------------------------------------------------
+#config.command-factory.command.command-name=fully-qualified-command-class-name
+
+
+##-----------------------------------------------------------------------------
+## This is the IP restrictor configuration
+##-----------------------------------------------------------------------------
+#config.ip-restrictor.class=org.apache.ftpserver.iprestrictor.FileIpRestrictor
+#config.ip-restrictor.file=./res/ip.gen
+
+
+##-----------------------------------------------------------------------------
+## Properties based default user manager configuration.
+##-----------------------------------------------------------------------------
+#config.user-manager.class=org.apache.ftpserver.usermanager.PropertiesUserManager
+#config.user-manager.admin-name=admin
+#config.user-manager.prop-file=./res/user.gen
+#config.user-manager.encrypt-passwords=true
+
+
+##-----------------------------------------------------------------------------
+## Database based user manager configuration
+##-----------------------------------------------------------------------------
+#config.user-manager.class=org.apache.ftpserver.usermanager.DbUserManager
+#config.user-manager.admin-name=admin
+#config.user-manager.data-source.class=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+#config.user-manager.data-source.server-name=localhost
+#config.user-manager.data-source.database-name=ftpdb
+#config.user-manager.data-source.user=user
+#config.user-manager.data-source.password=password
+#config.user-manager.sql-user-insert=INSERT INTO FTP_USER (uid, userpassword, homedirectory, enableflag, writepermission, idletime, uploadrate, downloadrate) VALUES ('{uid}', '{userpassword}', '{homedirectory}', '{enableflag}', '{writepermission}', {idletime}, {uploadrate}, {downloadrate})
+#config.user-manager.sql-user-update=UPDATE FTP_USER SET userpassword\='{userpassword}',homedirectory\='{homedirectory}',enableflag\='{enableflag}',writepermission\='{writepermission}',idletime\={idletime},uploadrate\={uploadrate},downloadrate\={downloadrate} WHERE uid\='{uid}'
+#config.user-manager.sql-user-delete=DELETE FROM FTP_USER WHERE uid \= '{uid}'
+#config.user-manager.sql-user-select=SELECT uid, userpassword, homedirectory, enableflag, writepermission, idletime, uploadrate, downloadrate FROM FTP_USER WHERE uid \= '{uid}'
+#config.user-manager.sql-user-select-all=SELECT uid FROM FTP_USER ORDER BY uid
+#config.user-manager.sql-user-authenticate=SELECT uid FROM FTP_USER WHERE uid\='{uid}' AND userpassword\='{userpassword}'
+#config.user-manager.sql-user-admin=SELECT uid FROM FTP_USER WHERE uid\='{uid}' AND WHERE uid\='admin'
+
+
+##-----------------------------------------------------------------------------
+## LDAP based user manager configuration
+##-----------------------------------------------------------------------------
+#config.user-manager.class=org.apache.ftpserver.usermanager.LdapUserManager
+#config.user-manager.admin-name=admin
+#config.user-manager.ldap-url=ldap\://localhost\:389
+#config.user-manager.ldap-admin-dn=cn=Manager,dc=apache,dc=org
+#config.user-manager.ldap-admin-password=secret
+#config.user-manager.ldap-authentication=simple
+#config.user-manager.ldap-user-base-dn=dc\=apache,dc\=org
+
+
+##-----------------------------------------------------------------------------
+## File system manager configuration.
+##-----------------------------------------------------------------------------
+#config.file-system-manager.class=org.apache.ftpserver.filesystem.NativeFileSystemManager
+#config.file-system-manager.create-home=false
+
+
+##------------------------------------------------------------------------------
+## All ftplets
+##------------------------------------------------------------------------------
+#config.ftplets=f1,f2
+
+
+##------------------------------------------------------------------------------
+## Ftplet f1 configuration
+##------------------------------------------------------------------------------
+#config.ftplet.f1.class=org.apache.ftpserver.ftplet.Ftplet1
+#config.ftplet.f1.param=value1
+
+
+##------------------------------------------------------------------------------
+## Ftplet f2 configuration
+##------------------------------------------------------------------------------
+#config.ftplet.f2.class=org.apache.ftpserver.ftplet.Ftplet2
+#config.ftplet.f2.param=value2
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/conf/ftpd.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,189 @@
+<?xml version="1.0"?>
+<!--
+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.
+ -->
+
+<!-- XML file based configuration -->
+<config>
+
+ <!-- This is the listener configuration. Additional listeners can be added if required.
+ If you want to support SSL connections, please specify ssl block -->
+ <!--
+ <listeners>
+ <default>
+ <class>org.apache.ftpserver.listener.mina.MinaListener</class>
+ <address>localhost</address>
+ <port>21</port>
+ <implicit-ssl>false</implicit-ssl>
+ <ssl>
+ <class>org.apache.ftpserver.ssl.DefaultSsl</class>
+ <keystore-file>./res/.keystore</keystore-file>
+ <keystore-password>password</keystore-password>
+ <keystore-type>JKS</keystore-type>
+ <keystore-algorithm>SunX509</keystore-algorithm>
+ <ssl-protocol>TLS</ssl-protocol>
+ <client-authentication>false</client-authentication>
+ <key-password>password</key-password>
+ </ssl> -->
+ <!-- Data connection configuration. If you want to support secure
+ data connection, please specify the ssl block.-->
+ <!--
+ <data-connection>
+ <class>org.apache.ftpserver.DefaultDataConnectionConfig</class>
+ <idle-time>10</idle-time>
+ <active>
+ <enable>true</enable>
+ <local-address>localhost</local-address>
+ <local-port>20</local-port>
+ <ip-check>false</ip-check>
+ </active>
+ <passive>
+ <address>localhost</address>
+ <ports>0</ports>
+ </passive>
+ <ssl>
+ <class>org.apache.ftpserver.ssl.DefaultSsl</class>
+ <keystore-file>./res/.keystore</keystore-file>
+ <keystore-password>password</keystore-password>
+ <keystore-type>JKS</keystore-type>
+ <keystore-algorithm>SunX509</keystore-algorithm>
+ <ssl-protocol>TLS</ssl-protocol>
+ <client-authentication>false</client-authentication>
+ <key-password>password</key-password>
+ </ssl>
+ </data-connection>
+ </default>
+
+ </listeners>
+ -->
+
+ <!-- Standard users admin and anonymous will be created by default.
+ <create-default-user>true</create-default-user>
+ -->
+
+
+ <!-- Ftp message configuration block
+ <message>
+ <class>org.apache.ftpserver.message.MessageResourceImpl</class>
+ <custom-message-dir>./res</custom-message-dir>
+ <languages>en,zh-tw</languages>
+ </message>
+ -->
+
+
+ <!-- Connection manager configuration block
+ <connection-manager>
+ <max-connection>20</max-connection>
+ <max-login>10</max-login>
+ <anonymous-login-enabled>true</anonymous-login-enabled>
+ <max-anonymous-login>10</max-anonymous-login>
+ <default-idle-time>60</default-idle-time>
+ <timeout-poll-inverval>60</timeout-poll-inverval>
+ </connection-manager>
+ -->
+
+
+ <!-- Command factory configuration block
+ <command-factory>
+ <command>
+ <command-name>fully-qualified-command-class-name</command-name>
+ </command>
+ </command-factory>
+ -->
+
+
+ <!-- IP restrictor configuration block
+ <ip-restrictor>
+ <class>org.apache.ftpserver.iprestrictor.FileIpRestrictor</class>
+ <file>./res/ip.gen</file>
+ </ip-restrictor>
+ -->
+
+
+ <!-- Default properties file based user manager configuration block
+ <user-manager>
+ <class>org.apache.ftpserver.usermanager.PropertiesUserManager</class>
+ <admin-name>admin</admin-name>
+ <prop-file>./res/user.gen</prop-file>
+ <encrypt-passwords>true</encrypt-passwords>
+ </user-manager>
+ -->
+
+
+ <!-- Database based user manager configuration
+ <user-manager>
+ <class>org.apache.ftpserver.usermanager.DbUserManager</class>
+ <admin-name>admin</admin-name>
+ <data-source>
+ <class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</class>
+ <server-name>localhost</server-name>
+ <database-name>ftpdb</database-name>
+ <user>user</user>
+ <password>password</password>
+ </data-source>
+ <sql-user-insert>INSERT INTO FTP_USER (uid, userpassword, homedirectory, enableflag, writepermission, idletime, uploadrate, downloadrate) VALUES ('{uid}', '{userpassword}', '{homedirectory}', '{enableflag}', '{writepermission}', {idletime}, {uploadrate}, {downloadrate})</sql-user-insert>
+ <sql-user-update>UPDATE FTP_USER SET userpassword='{userpassword}',homedirectory='{homedirectory}',enableflag='{enableflag}',writepermission='{writepermission}',idletime={idletime},uploadrate={uploadrate},downloadrate={downloadrate} WHERE uid='{uid}'</sql-user-update>
+ <sql-user-delete>DELETE FROM FTP_USER WHERE uid = '{uid}'</sql-user-delete>
+ <sql-user-select>SELECT uid, userpassword, homedirectory, enableflag, writepermission, idletime, uploadrate, downloadrate FROM FTP_USER WHERE uid = '{uid}'</sql-user-select>
+ <sql-user-select-all>SELECT uid FROM FTP_USER ORDER BY uid</sql-user-select-all>
+ <sql-user-authenticate>SELECT uid from FTP_USER WHERE uid='{uid}' AND userpassword='{userpassword}'</sql-user-authenticate>
+ <sql-user-admin>SELECT uid FROM FTP_USER WHERE uid='{uid}' AND uid='admin'</sql-user-admin>
+ </user-manager>
+ -->
+
+
+ <!-- LDAP based user manager
+ <user-manager>
+ <class>org.apache.ftpserver.usermanager.LdapUserManager</class>
+ <admin-name>admin</admin-name>
+ <ldap-url>ldap://localhost:389</ldap-url>
+ <ldap-admin-dn>cn=Manager,dc=apache,dc=org</ldap-admin-dn>
+ <ldap-admin-password>secret</ldap-admin-password>
+ <ldap-authentication>simple</ldap-authentication>
+ <ldap-user-base-dn>dc=apache,dc=org</ldap-user-base-dn>
+ </user-manager>
+ -->
+
+
+ <!-- file system manager configuration block
+ <file-system-manager>
+ <class>org.apache.ftpserver.filesystem.NativeFileSystemManager</class>
+ <create-home>false</create-home>
+ </file-system-manager>
+ -->
+
+
+ <!-- All ftplets
+ <ftplets>f1,f2</ftplets>
+ -->
+
+
+ <!-- Ftplet configuration
+ <ftplet>
+ <f1>
+ <class>org.apache.ftpserver.ftplet.Ftplet1</class>
+ <param>value1</param>
+ </f1>
+ <f2>
+ <class>org.apache.ftpserver.ftplet.Ftplet2</class>
+ <param>value2</param>
+ </f2>
+ </ftplet>
+ -->
+
+</config>
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/ftp-db.sql
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/ftp-db.sql (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/ftp-db.sql 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,29 @@
+managermanager-- 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.
+
+CREATE TABLE FTP_USER (
+ uid VARCHAR(64) NOT NULL PRIMARY KEY,
+ userpassword VARCHAR(64),
+ homedirectory VARCHAR(128) NOT NULL,
+ enableflag BOOLEAN DEFAULT TRUE,
+ writepermission BOOLEAN DEFAULT FALSE,
+ idletime INT DEFAULT 0,
+ uploadrate INT DEFAULT 0,
+ downloadrate INT DEFAULT 0,
+ maxloginnumber INT DEFAULT 0,
+ maxloginperip INT DEFAULT 0
+);
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/home/README.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/home/README.txt (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/home/README.txt 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1 @@
+Default user root directory.
\ No newline at end of file
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/README.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/README.txt (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/README.txt 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1 @@
+All the log files are stored here.
\ No newline at end of file
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/log.gen
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/log.gen (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/log/log.gen 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,3 @@
+[ INFO] 2007-03-16 18:54:07,765 Creating user : admin
+[ INFO] 2007-03-16 18:54:07,796 Creating user : anonymous
+[ INFO] 2007-03-16 18:54:07,968 ------- Apache FTP Server started ------
Added: labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/user.gen
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/user.gen (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/ftp/src/main/resources/res/user.gen 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,25 @@
+#Generated file - don't edit (please)
+#Sat Mar 17 00:23:07 ADT 2007
+ftpserver.user.anonymous.writepermission=false
+ftpserver.user.anonymous.maxloginnumber=20
+ftpserver.user.anonymous.enableflag=true
+ftpserver.user.admin.homedirectory=./res/home
+ftpserver.user.anonymous.userpassword=D41D8CD98F00B204E9800998ECF8427E
+ftpserver.user.anonymous.homedirectory=./res/home
+ftpserver.user.anonymous.idletime=300
+ftpserver.user.esb.maxloginnumber=0
+ftpserver.user.admin.enableflag=true
+ftpserver.user.admin.idletime=0
+ftpserver.user.esb.downloadrate=0
+ftpserver.user.esb.uploadrate=0
+ftpserver.user.esb.idletime=0
+ftpserver.user.anonymous.uploadrate=4800
+ftpserver.user.anonymous.maxloginperip=2
+ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
+ftpserver.user.esb.userpassword=EFB03B68F7A0C2A331FC61A491C4B2D7
+ftpserver.user.esb.writepermission=true
+ftpserver.user.anonymous.downloadrate=4800
+ftpserver.user.esb.homedirectory=./res/home
+ftpserver.user.esb.maxloginperip=0
+ftpserver.user.admin.writepermission=true
+ftpserver.user.esb.enableflag=true
Modified: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/build.xml 2007-03-20 23:51:55 UTC (rev 10372)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/build.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -90,6 +90,18 @@
<include name="META-INF/*.xml"/>
</fileset>
</jar>
+ <jar jarfile="${qa.build.lib}/ftp-test.esb">
+ <fileset dir="${qa.junit.classes}">
+ <include name="org/jboss/soa/esb/server/*.class"/>
+ </fileset>
+ <fileset dir="${qa.junit.resources}/server/simple">
+ <include name="test-service.xml"/>
+ </fileset>
+ <fileset dir="${qa.junit.resources}/server/ftp">
+ <include name="esb-jbm-service.xml"/>
+ <include name="META-INF/*.xml"/>
+ </fileset>
+ </jar>
</target>
<target name="one-test" if="test"
Added: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/deployment.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/deployment.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/deployment.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:test=server</depends>
+ <depends>jboss.messaging.destination:service=Queue,name=ftptest</depends>
+</jbossesb-deployment>
\ No newline at end of file
Added: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/jboss-esb.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/META-INF/jboss-esb.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,65 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <ftp-provider name="FTPprovider" hostname="localhost" >
+ <ftp-bus busid="helloFTPChannel" >
+ <ftp-message-filter
+ username="esb"
+ password="esb"
+ passive="false"
+ directory="/"
+ input-suffix=".dat"
+ work-suffix=".esbWorking"
+ post-delete="false"
+ post-suffix=".COMPLETE"
+ error-delete="false"
+ error-suffix=".HAS_ERROR"
+ />
+ </ftp-bus>
+ </ftp-provider>
+
+ <jms-provider name="JBossMQ"
+ connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost" >
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/ftptest"
+ />
+ </jms-bus>
+
+ </jms-provider>
+
+ </providers>
+
+ <services>
+ <service
+ category="myCategory"
+ name="myFileListener"
+ description="Hello World File Action (esb listener)" >
+ <listeners>
+ <ftp-listener name="FtpGateway"
+ busidref="helloFTPChannel"
+ maxThreads="1"
+ is-gateway="true"
+ >
+ <property name="pollLatencySeconds" value="5"/>
+ </ftp-listener>
+ <jms-listener name="helloWorldFileAction"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <action name="displayAction"
+ class="org.jboss.soa.esb.server.MyAction"
+ process="process">
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/esb-jbm-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/esb-jbm-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/ftp/esb-jbm-service.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=ftptest"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+</server>
Modified: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple/META-INF/jboss-esb.xml 2007-03-20 23:51:55 UTC (rev 10372)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple/META-INF/jboss-esb.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -40,7 +40,7 @@
</listeners>
<actions>
<action name="displayAction"
- class="org.jboss.soa.esb.server.MyJMSListenerAction"
+ class="org.jboss.soa.esb.server.MyAction"
process="process">
</action>
</actions>
Modified: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple-scoped/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple-scoped/META-INF/jboss-esb.xml 2007-03-20 23:51:55 UTC (rev 10372)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/resources/server/simple-scoped/META-INF/jboss-esb.xml 2007-03-20 23:54:42 UTC (rev 10373)
@@ -40,7 +40,7 @@
</listeners>
<actions>
<action name="displayAction"
- class="org.jboss.soa.esb.server.MyJMSListenerAction"
+ class="org.jboss.soa.esb.server.MyAction"
process="process">
</action>
</actions>
Copied: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyAction.java (from rev 10367, labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyJMSListenerAction.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyAction.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyAction.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,79 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.mx.util.MBeanProxyExt;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+
+public class MyAction extends AbstractActionPipelineProcessor
+{
+ protected ConfigTree _config;
+
+ public MyAction(ConfigTree config)
+ {
+ _config = config;
+ }
+
+ public Message noOperation(Message message)
+ {
+ return message;
+ }
+
+ public Message process(Message message) throws ActionProcessingException
+ {
+ logHeader();
+ System.out.println("Body: " + new String(message.getBody().getContents()));
+ logFooter();
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ StatsMBean stats ;
+ try
+ {
+ stats = (StatsMBean)MBeanProxyExt.create(StatsMBean.class, StatsMBean.objectName, server);
+ }
+ catch (final MalformedObjectNameException mone)
+ {
+ throw new ActionProcessingException("Error creating MBean proxy", mone) ;
+ }
+ stats.setExecutedVersion("scope1");
+ return message;
+ }
+
+ // This makes it easier to read on the console
+ private void logHeader()
+ {
+ System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ }
+
+ private void logFooter()
+ {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+
+}
Deleted: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyJMSListenerAction.java 2007-03-20 23:51:55 UTC (rev 10372)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/MyJMSListenerAction.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -1,79 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.server;
-
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.mx.util.MBeanProxyExt;
-
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-
-public class MyJMSListenerAction extends AbstractActionPipelineProcessor
-{
- protected ConfigTree _config;
-
- public MyJMSListenerAction(ConfigTree config)
- {
- _config = config;
- }
-
- public Message noOperation(Message message)
- {
- return message;
- }
-
- public Message process(Message message) throws ActionProcessingException
- {
- logHeader();
- System.out.println("Body: " + new String(message.getBody().getContents()));
- logFooter();
- MBeanServer server = MBeanServerLocator.locateJBoss();
- StatsMBean stats ;
- try
- {
- stats = (StatsMBean)MBeanProxyExt.create(StatsMBean.class, StatsMBean.objectName, server);
- }
- catch (final MalformedObjectNameException mone)
- {
- throw new ActionProcessingException("Error creating MBean proxy", mone) ;
- }
- stats.setExecutedVersion("scope1");
- return message;
- }
-
- // This makes it easier to read on the console
- private void logHeader()
- {
- System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
- }
-
- private void logFooter()
- {
- System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
- }
-
-
-}
Added: labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/FtpUnitTestCase.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/FtpUnitTestCase.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/qa/junit/src/org/jboss/soa/esb/server/ftp/unit/FtpUnitTestCase.java 2007-03-20 23:54:42 UTC (rev 10373)
@@ -0,0 +1,106 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server.ftp.unit;
+
+import junit.framework.Test;
+import org.jboss.test.JBossTestCase;
+import org.jboss.soa.esb.server.StatsMBean;
+
+import javax.management.ObjectName;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Date;
+
+/**
+ * Sample client for the jboss container.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z scott.stark at jboss.org $
+ */
+
+public class FtpUnitTestCase
+ extends JBossTestCase
+{
+ public FtpUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testFtp() throws Exception
+ {
+ sendFtp();
+ Thread.sleep(10000); // wait for message to post.
+ String version = (String)getServer().getAttribute(new ObjectName(StatsMBean.objectName), "ExecutedVersion");
+ assertEquals(version, "scope1");
+ }
+
+ public void sendFtp() throws Exception
+ {
+
+ final String hostname = "localhost";
+ final String username = "esb";
+ final String password = "esb";
+ final String filename = "FtpUnitTestCase-" + new Date().getTime() + ".dat";
+ final String contents = "Hello World from FTP";
+
+ final URL url;
+ final String filenameVal;
+ if (filename.charAt(0) == '/')
+
+ {
+ filenameVal = (filename.length() > 1 ? "%2F" + filename.substring(1) : "%2F");
+ }
+
+ else
+
+ {
+ filenameVal = filename;
+ }
+
+ url = new URL("ftp://" + username + ":" + password + "@" + hostname + "/" + filenameVal);
+
+ final URLConnection connection;
+ connection = url.openConnection();
+ connection.setDoOutput(true);
+ final OutputStream os;
+ os = connection.getOutputStream();
+ try
+ {
+ final PrintStream ps = new PrintStream(os);
+ ps.print(contents);
+ ps.close();
+ }
+ finally
+
+ {
+ os.close();
+ }
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(FtpUnitTestCase.class, "ftp-test.esb");
+ }
+
+}
More information about the jboss-svn-commits
mailing list