[jboss-svn-commits] JBL Code SVN: r22745 - in labs/jbossesb/trunk/product: rosetta/src/org/jboss/internal/soa/esb/util and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Sep 13 17:38:30 EDT 2008


Author: mark.little at jboss.com
Date: 2008-09-13 17:38:30 -0400 (Sat, 13 Sep 2008)
New Revision: 22745

Modified:
   labs/jbossesb/trunk/product/docs/AdministrationGuide.odt
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
Log:
https://jira.jboss.org/jira/browse/JBESB-1995

Modified: labs/jbossesb/trunk/product/docs/AdministrationGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpImpl.java	2008-09-13 21:01:43 UTC (rev 22744)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpImpl.java	2008-09-13 21:38:30 UTC (rev 22745)
@@ -60,76 +60,78 @@
 
 public class FtpImpl implements RemoteFileSystem
 {
-	private static final Logger _logger = Logger.getLogger(FtpImpl.class);
+        private static final Logger _logger = Logger.getLogger(FtpImpl.class);
 
-	private static final String TMP_SUFFIX = ".rosettaPart";
+        private static final String TMP_SUFFIX = ".rosettaPart";
 
-	private boolean m_bPassive;
+        private boolean m_bPassive;
 
-	private int m_iPort;
-	private int _timeout = 0;
+        private int m_iPort;
+        private int _timeout = 0;
 
-	protected FTPClient m_oConn ;
+        protected FTPClient m_oConn ;
 
-	private FTPEpr m_oEpr;
+        private FTPEpr m_oEpr;
 
-	protected ConfigTree m_oParms;
+        protected ConfigTree m_oParms;
 
-	private String m_sFtpServer, m_sUser, m_sPasswd;
+        private String m_sFtpServer, m_sUser, m_sPasswd;
 
-	private String m_sRemoteDir, m_sLocalDir;
+        private String m_sRemoteDir, m_sLocalDir;
+        
+        private int renameRetry;
 
-	/**
-	 * Checks validity and completeness of parameters, and keeps the info
-	 * internally for subsequent FTP requests
-	 * 
-	 * @param p_oP
-	 *            ConfigTree
-	 * @throws ConfigurationException :
-	 *             if parameters are invalid or incomplete
-	 *             <li>Parameters: (XML attributes at the root level) </li>
-	 *             <li> ftpServer = name or IP of FTP server </li>
-	 *             <li> ftpUser = login ID for server </li>
-	 *             <li> ftpPassword </li>
-	 *             <li> localDirURI = absolute path in the local filesystem
-	 *             </li>
-	 *             <li> remoteDirURI = remote path is relative to ftp user home
-	 *             in remote computer </li>
-	 */
+        /**
+         * Checks validity and completeness of parameters, and keeps the info
+         * internally for subsequent FTP requests
+         * 
+         * @param p_oP
+         *            ConfigTree
+         * @throws ConfigurationException :
+         *             if parameters are invalid or incomplete
+         *             <li>Parameters: (XML attributes at the root level) </li>
+         *             <li> ftpServer = name or IP of FTP server </li>
+         *             <li> ftpUser = login ID for server </li>
+         *             <li> ftpPassword </li>
+         *             <li> localDirURI = absolute path in the local filesystem
+         *             </li>
+         *             <li> remoteDirURI = remote path is relative to ftp user home
+         *             in remote computer </li>
+         */
 
-	public FtpImpl (ConfigTree p_oP, boolean p_bConnect)
-			throws ConfigurationException, RemoteFileSystemException
-	{
-		m_oParms = p_oP;
-		initialize(p_bConnect);
-	}
+        public FtpImpl (ConfigTree p_oP, boolean p_bConnect)
+                        throws ConfigurationException, RemoteFileSystemException
+        {
+                m_oParms = p_oP;
+                initialize(p_bConnect);
+        }
 
-	public FtpImpl (FTPEpr p_oP, boolean p_bConnect)
-			throws ConfigurationException, RemoteFileSystemException
-	{
-		this(p_oP) ;
-		// TODO there is still a bit of space for improvements here.
-		configTreeFromEpr() ;
-		
-		initialize(p_bConnect) ;
-	}
+        public FtpImpl (FTPEpr p_oP, boolean p_bConnect)
+                        throws ConfigurationException, RemoteFileSystemException
+        {
+                this(p_oP) ;
+                // TODO there is still a bit of space for improvements here.
+                configTreeFromEpr() ;
+                
+                initialize(p_bConnect) ;
+        }
 
-	public FtpImpl (FTPEpr p_oP)
-			throws ConfigurationException
-	{
-		m_oEpr = p_oP;
+        public FtpImpl (FTPEpr p_oP)
+                        throws ConfigurationException
+        {
+                m_oEpr = p_oP;
 
-		final URI uri;
-		try
-		{
-			uri = m_oEpr.getURI();
-		}
-		catch (URISyntaxException e)
-		{
-			throw new ConfigurationException(e);
-		}
+                final URI uri;
+                try
+                {
+                        uri = m_oEpr.getURI();
+                }
+                catch (URISyntaxException e)
+                {
+                        throw new ConfigurationException(e);
+                }
 
-		m_sFtpServer = uri.getHost();
+                m_sFtpServer = uri.getHost();
 
                 String[] sa = null;
 
@@ -145,19 +147,19 @@
                     m_sUser = sa[0] ;
                 }
 
-		m_sRemoteDir = uri.getPath();
+                m_sRemoteDir = uri.getPath();
 
-		final String tmpdir = System.getProperty("java.io.tmpdir");
-		if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
-			m_sRemoteDir = ModulePropertyManager.getPropertyManager(
-					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-					Environment.FTP_REMOTEDIR, tmpdir);
+                final String tmpdir = System.getProperty("java.io.tmpdir");
+                if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
+                        m_sRemoteDir = ModulePropertyManager.getPropertyManager(
+                                        ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+                                        Environment.FTP_REMOTEDIR, tmpdir);
 
-		m_iPort = uri.getPort();
+                m_iPort = uri.getPort();
 
-		m_sLocalDir = ModulePropertyManager.getPropertyManager(
-				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-				Environment.FTP_LOCALDIR, tmpdir);
+                m_sLocalDir = ModulePropertyManager.getPropertyManager(
+                                ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+                                Environment.FTP_LOCALDIR, tmpdir);
 
         File oLocalDir = new File(m_sLocalDir);
         if(!oLocalDir.exists()) {
@@ -168,106 +170,122 @@
 
         m_bPassive = m_oEpr.getPassive();
 
-		String timeout = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.FTP_SOCKET_TIMEOUT, null);
-		
-		if (timeout != null)
-		{
-			try
-			{
-				_timeout = Integer.parseInt(timeout);
-			}
-			catch (NumberFormatException ex)
-			{
-				throw new ConfigurationException("Invalid timeout specified.", ex);
-			}
-		}
-		else
-			_timeout = 0;
-	}
+                String timeout = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.FTP_SOCKET_TIMEOUT, null);
+                
+                if (timeout != null)
+                {
+                        try
+                        {
+                                _timeout = Integer.parseInt(timeout);
+                        }
+                        catch (NumberFormatException ex)
+                        {
+                                throw new ConfigurationException("Invalid timeout specified.", ex);
+                        }
+                }
+                else
+                        _timeout = 0;
+        }
 
-	public FtpImpl (List<KeyValuePair> p_oAttribs, boolean p_bConnect)
-			throws ConfigurationException, RemoteFileSystemException
-	{
-		m_oParms = new ConfigTree("fromProps");
-		for (KeyValuePair oCurr : p_oAttribs)
-			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
-		initialize(p_bConnect);
-	}
+        public FtpImpl (List<KeyValuePair> p_oAttribs, boolean p_bConnect)
+                        throws ConfigurationException, RemoteFileSystemException
+        {
+                m_oParms = new ConfigTree("fromProps");
+                for (KeyValuePair oCurr : p_oAttribs)
+                        m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
+                initialize(p_bConnect);
+        }
 
-	protected void checkParms () throws ConfigurationException
-	{
-		String att = m_oParms.getAttribute(FileEpr.URL_TAG);
-		URI uri = null;
-		
-		try
-		{
-			if (att != null)
-				uri = new URI(att);
-		}
-		catch (URISyntaxException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		
-		m_sFtpServer = (null != uri) ? uri.getHost() : m_oParms
-				.getAttribute(PARMS_FTP_SERVER);
-		if (null == m_sFtpServer)
-			throw new ConfigurationException("No FTP server specified");
+        protected void checkParms () throws ConfigurationException
+        {
+                String att = m_oParms.getAttribute(FileEpr.URL_TAG);
+                URI uri = null;
+                
+                try
+                {
+                        if (att != null)
+                                uri = new URI(att);
+                }
+                catch (URISyntaxException ex)
+                {
+                        throw new ConfigurationException(ex);
+                }
+                
+                m_sFtpServer = (null != uri) ? uri.getHost() : m_oParms
+                                .getAttribute(PARMS_FTP_SERVER);
+                if (null == m_sFtpServer)
+                        throw new ConfigurationException("No FTP server specified");
 
-		String[] sa = (null == uri) ? null : uri.getUserInfo().split(":");
-		m_sUser = (null != sa) ? sa[0] : m_oParms.getAttribute(PARMS_USER);
-		if (null == m_sUser)
-			throw new ConfigurationException("No username specified for FTP");
+                String[] sa = (null == uri) ? null : uri.getUserInfo().split(":");
+                m_sUser = (null != sa) ? sa[0] : m_oParms.getAttribute(PARMS_USER);
+                if (null == m_sUser)
+                        throw new ConfigurationException("No username specified for FTP");
 
-		m_sPasswd = ((null != sa) && (sa.length > 1)) ? sa[1] : m_oParms.getAttribute(PARMS_PASSWD);
+                m_sPasswd = ((null != sa) && (sa.length > 1)) ? sa[1] : m_oParms.getAttribute(PARMS_PASSWD);
 
-		m_sRemoteDir = (null != uri) ? uri.getPath() : m_oParms
-				.getAttribute(PARMS_REMOTE_DIR);
-		if (null == m_sRemoteDir) m_sRemoteDir = "";
+                m_sRemoteDir = (null != uri) ? uri.getPath() : m_oParms
+                                .getAttribute(PARMS_REMOTE_DIR);
+                if (null == m_sRemoteDir) m_sRemoteDir = "";
 
-		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
-		if (null == m_sLocalDir) m_sLocalDir = ".";
+                m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
+                if (null == m_sLocalDir) m_sLocalDir = ".";
 
-		String sAux = m_oParms.getAttribute(PARMS_PORT);
-		m_iPort = (null != uri) ? uri.getPort() : (null == sAux) ? 21 : Integer
-				.parseInt(sAux);
-		
-		m_bPassive = false;
-		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
-		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
+                String sAux = m_oParms.getAttribute(PARMS_PORT);
+                m_iPort = (null != uri) ? uri.getPort() : (null == sAux) ? 21 : Integer
+                                .parseInt(sAux);
+                
+                m_bPassive = false;
+                sAux = m_oParms.getAttribute(PARMS_PASSIVE);
+                m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
+                
+                String renameRetryString = ModulePropertyManager.getPropertyManager(
+                        ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+                        Environment.FTP_RENAME_RETRY, null);
 
-		return;
-	}
+                if (renameRetryString != null)
+                {
+                    try
+                    {
+                        renameRetry = Integer.parseInt(renameRetryString);
+                    }
+                    catch (Exception ex)
+                    {
+                        throw new ConfigurationException("Invalid rename retry limit: "+renameRetryString);
+                    }
+                }
+                else
+                    renameRetry = DEFAULT_RENAME_RETRY_NUMBER;
+        }
 
-	protected void configTreeFromEpr () throws RemoteFileSystemException
-	{
-		m_oParms = new ConfigTree("fromEpr");
-		try
-		{
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
-					m_sFtpServer);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
-			if (m_sPasswd != null)
-			    m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
-					m_sRemoteDir);
-			if (m_iPort > 0)
-			{
-			    m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
-					.toString(m_iPort));
-			}
-			m_oParms
-					.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
-					.toString(false));
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
-					.toString(m_bPassive));
-		}
-		catch (Exception e)
-		{
-			throw new RemoteFileSystemException(e);
-		}
-	}
+        protected void configTreeFromEpr () throws RemoteFileSystemException
+        {
+                m_oParms = new ConfigTree("fromEpr");
+                try
+                {
+                        m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
+                                        m_sFtpServer);
+                        m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
+                        if (m_sPasswd != null)
+                            m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
+                        m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
+                                        m_sRemoteDir);
+                        if (m_iPort > 0)
+                        {
+                            m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
+                                        .toString(m_iPort));
+                        }
+                        m_oParms
+                                        .setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
+                        m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
+                                        .toString(false));
+                        m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
+                                        .toString(m_bPassive));
+                }
+                catch (Exception e)
+                {
+                        throw new RemoteFileSystemException(e);
+                }
+        }
 
         /*
          * (non-Javadoc)
@@ -369,15 +387,15 @@
                 }
         }
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
-	 */
-	public String getRemoteDir ()
-	{
-		return m_sRemoteDir;
-	}
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
+         */
+        public String getRemoteDir ()
+        {
+                return m_sRemoteDir;
+        }
 
         protected void initialize (boolean bConnect)
             throws ConfigurationException, RemoteFileSystemException
@@ -444,25 +462,25 @@
             }
         }
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
-	 */
-	public void quit ()
-	{
-		if (null != m_oConn)
-		{
-			try
-			{
-				m_oConn.quit();
-				m_oConn.disconnect() ;
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
+         */
+        public void quit ()
+        {
+                if (null != m_oConn)
+                {
+                        try
+                        {
+                                m_oConn.quit();
+                                m_oConn.disconnect() ;
+                        }
+                        catch (Exception e)
+                        {
+                        }
+                }
+        }
 
         /*
          * (non-Javadoc)
@@ -586,10 +604,31 @@
                 {
                     throw new RemoteFileSystemException("Failed to upload contents: " + m_oConn.getReplyString()) ;
                 }
-                if (!m_oConn.rename(sRemoteTmp, p_sRemoteName))
+                
+                boolean retryProblem = true;  // https://jira.jboss.org/jira/browse/JBESB-1995
+
+                for (int i = 0; i < renameRetry; i++)
                 {
+                    if (m_oConn.rename(sRemoteTmp, p_sRemoteName))
+                    {
+                        retryProblem = false;
+                        
+                        break;
+                    }
+                    else
+                    {
+                        try
+                        {
+                            Thread.sleep(DEFAULT_RENAME_RETRY_TIMEOUT);
+                        }
+                        catch (final Exception ex)
+                        {
+                        }
+                    }
+                }
+                
+                if (retryProblem)
                     throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
-                }
             }
             catch (final IOException ioe)
             {

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-09-13 21:01:43 UTC (rev 22744)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-09-13 21:38:30 UTC (rev 22745)
@@ -24,90 +24,93 @@
 
 public class Environment
 {
-	public enum Transports
-	{
-		File, FTP, JMS, SQL, Hibernate;
-	}
-	
-	public static final String PROPERTIES_FILE = "org.jboss.soa.esb.propertyFile";
-	
-	/**
-	 * Binding properties
-	 */
-	public static final String ESB_BIND_ADDRESS = "jboss.esb.bind.address" ;
-	/*
-	 * Transport specific properties.
-	 */
+        public enum Transports
+        {
+                File, FTP, JMS, SQL, Hibernate;
+        }
 
+        public static final String PROPERTIES_FILE = "org.jboss.soa.esb.propertyFile";
+
+        /**
+         * Binding properties
+         */
+        public static final String ESB_BIND_ADDRESS = "jboss.esb.bind.address" ;
+        /*
+         * Transport specific properties.
+         */
+
     public static final String DEFAULT_INVM_SCOPE     = "jboss.esb.invm.scope.default";
 
     public static final String SMTP_HOST     = "org.jboss.soa.esb.mail.smtp.host";
-	public static final String SMTP_USERNAME = "org.jboss.soa.esb.mail.smtp.user";
-	public static final String SMTP_PASSWORD = "org.jboss.soa.esb.mail.smtp.password";
-	public static final String SMTP_PORT     = "org.jboss.soa.esb.mail.smtp.port";
-	public static final String SMTP_FROM     = "org.jboss.soa.esb.mail.smtp.from";
-	public static final String SMTP_AUTH     = "org.jboss.soa.esb.mail.smtp.auth";
-	
-	public static final String FTP_LOCALDIR  = "org.jboss.soa.esb.ftp.localdir";
-	public static final String FTP_REMOTEDIR = "org.jboss.soa.esb.ftp.remotedir";
-	public static final String FTP_SOCKET_TIMEOUT = "org.jboss.soa.esb.ftp.timeout";
-	
-	public static final String JMS_CONNECTION_POOL_SIZE = "org.jboss.soa.esb.jms.connectionPool";
-	public static final String JMS_SESSION_SLEEP        = "org.jboss.soa.esb.jms.sessionSleep";
-	
-	/*
-	 * Core properties
-	 */
-	public static final String JNDI_SERVER_URL                = "org.jboss.soa.esb.jndi.server.url";
-	public static final String JNDI_SERVER_CONTEXT_FACTORY    = "org.jboss.soa.esb.jndi.server.context.factory";
-	public static final String JNDI_SERVER_PKG_PREFIX         = "org.jboss.soa.esb.jndi.server.pkg.prefix";
-	public static final String JNDI_SERVER_TEST_LOOKUP         = "org.jboss.soa.esb.jndi.test.lookup";
-	public static final String PARAMS_REPOS_IMPL_CLASS        = "org.jboss.soa.esb.paramsRepository.class";
-	public static final String OBJECT_STORE_CONFIG_FILE       = "org.jboss.soa.esb.objStore.configFile";
-	public static final String ENCRYPT_FACTORY_CLASS          = "org.jboss.soa.esb.encryption.factory.class";
+        public static final String SMTP_USERNAME = "org.jboss.soa.esb.mail.smtp.user";
+        public static final String SMTP_PASSWORD = "org.jboss.soa.esb.mail.smtp.password";
+        public static final String SMTP_PORT     = "org.jboss.soa.esb.mail.smtp.port";
+        public static final String SMTP_FROM     = "org.jboss.soa.esb.mail.smtp.from";
+        public static final String SMTP_AUTH     = "org.jboss.soa.esb.mail.smtp.auth";
+
+        public static final String FTP_LOCALDIR  = "org.jboss.soa.esb.ftp.localdir";
+        public static final String FTP_REMOTEDIR = "org.jboss.soa.esb.ftp.remotedir";
+        public static final String FTP_SOCKET_TIMEOUT = "org.jboss.soa.esb.ftp.timeout";
+        public static final String FTP_RENAME_RETRY = "org.jboss.soa.esb.ftp.renameretry";
+
+        public static final String JMS_CONNECTION_POOL_SIZE = "org.jboss.soa.esb.jms.connectionPool";
+        public static final String JMS_SESSION_SLEEP        = "org.jboss.soa.esb.jms.sessionSleep";
+
+        public static final String WS_RETURN_STACK_TRACE = "org.jboss.soa.esb.ws.returnStackTrace";
+        public static final String WS_TIMEOUT = "org.jboss.soa.esb.ws.timeout" ;
+        /*
+         * Core properties
+         */
+        public static final String JNDI_SERVER_URL                = "org.jboss.soa.esb.jndi.server.url";
+        public static final String JNDI_SERVER_CONTEXT_FACTORY    = "org.jboss.soa.esb.jndi.server.context.factory";
+        public static final String JNDI_SERVER_PKG_PREFIX         = "org.jboss.soa.esb.jndi.server.pkg.prefix";
+        public static final String JNDI_SERVER_TEST_LOOKUP         = "org.jboss.soa.esb.jndi.test.lookup";
+        public static final String PARAMS_REPOS_IMPL_CLASS        = "org.jboss.soa.esb.paramsRepository.class";
+        public static final String OBJECT_STORE_CONFIG_FILE       = "org.jboss.soa.esb.objStore.configFile";
+        public static final String ENCRYPT_FACTORY_CLASS          = "org.jboss.soa.esb.encryption.factory.class";
     public static final String LOAD_BALANCER_POLICY           = "org.jboss.soa.esb.loadbalancer.policy";
     public static final String REDELIVER_DLS_SERVICE_ON       = "org.jboss.soa.esb.dls.redeliver";
     public static final String REGISTRY_CACHE_LIFE_MILLIS    = "org.jboss.soa.esb.registry.cache.life";
     public static final String REMOVE_DEAD_EPR                = "org.jboss.soa.esb.failure.detect.removeDeadEPR";
-    	public static final String EXCEPTION_ON_DELIVERY_FAILURE = "org.jboss.soa.esb.exceptionOnDeliverFailure";
-    	
-	/** 
-	 * The Registry Query Manager URI defines the endPoint where registry queries can be made. 
-	 */
-	public static final String REGISTRY_QUERY_MANAGER_URI     = "org.jboss.soa.esb.registry.queryManagerURI";
-	/** 
-	 * The Registry Lifecycle Manager URI defines the endPoint where service information can be published to.
-	 */
-	public static final String REGISTRY_LIFECYCLE_MANAGER_URI = "org.jboss.soa.esb.registry.lifeCycleManagerURI";
+        public static final String EXCEPTION_ON_DELIVERY_FAILURE = "org.jboss.soa.esb.exceptionOnDeliverFailure";
+
+        /**
+         * The Registry Query Manager URI defines the endPoint where registry queries can be made.
+         */
+        public static final String REGISTRY_QUERY_MANAGER_URI     = "org.jboss.soa.esb.registry.queryManagerURI";
+        /**
+         * The Registry Lifecycle Manager URI defines the endPoint where service information can be published to.
+         */
+        public static final String REGISTRY_LIFECYCLE_MANAGER_URI = "org.jboss.soa.esb.registry.lifeCycleManagerURI";
     /**
      * The Registry Implementation class, a light wrapper class.
      */
-	public static final String REGISTRY_IMPEMENTATION_CLASS = "org.jboss.soa.esb.registry.implementationClass";
-	/** 
-	 * The Registry Factory Class setting specifies which JAXR implementation should be used.
-	 */
-	public static final String REGISTRY_FACTORY_CLASS         = "org.jboss.soa.esb.registry.factoryClass";
-	/**
-	 * The user used to query and publish to the registry.
-	 */
-	public static final String REGISTRY_USER                  = "org.jboss.soa.esb.registry.user";
-	/**
-	 * The password for the registry user.
-	 */
-	public static final String REGISTRY_PASSWORD              = "org.jboss.soa.esb.registry.password";
-	/** 
-	 * The Registry Scout Transport Class property defines which communication protocol Scout should use to communicate
-	 * with the UDDI registry. Note that this parameter is Scout specific.
-	 */
-	public static final String REGISTRY_SCOUT_TRANSPORT_CLASS = "org.jboss.soa.esb.scout.proxy.transportClass";
-	/** 
-	 * Property that holds directory to use with the helper EPRManager class.
-	 */
-	public static final String REGISTRY_FILE_HELPER_DIR       = "org.jboss.soa.esb.registry.file.directory";
+        public static final String REGISTRY_IMPEMENTATION_CLASS = "org.jboss.soa.esb.registry.implementationClass";
+        /**
+         * The Registry Factory Class setting specifies which JAXR implementation should be used.
+         */
+        public static final String REGISTRY_FACTORY_CLASS         = "org.jboss.soa.esb.registry.factoryClass";
+        /**
+         * The user used to query and publish to the registry.
+         */
+        public static final String REGISTRY_USER                  = "org.jboss.soa.esb.registry.user";
+        /**
+         * The password for the registry user.
+         */
+        public static final String REGISTRY_PASSWORD              = "org.jboss.soa.esb.registry.password";
+        /**
+         * The Registry Scout Transport Class property defines which communication protocol Scout should use to communicate
+         * with the UDDI registry. Note that this parameter is Scout specific.
+         */
+        public static final String REGISTRY_SCOUT_TRANSPORT_CLASS = "org.jboss.soa.esb.scout.proxy.transportClass";
+        /**
+         * Property that holds directory to use with the helper EPRManager class.
+         */
+        public static final String REGISTRY_FILE_HELPER_DIR       = "org.jboss.soa.esb.registry.file.directory";
     /**
      * Property that holds the setting to the semantic equivalence scheme to use.
      */
-	public static final String REGISTRY_SEMANTIC_EQUIVALENCES = "org.jboss.soa.esb.registry.semanticEquivalences";
+        public static final String REGISTRY_SEMANTIC_EQUIVALENCES = "org.jboss.soa.esb.registry.semanticEquivalences";
     /**
      * Property that holds the postal address scheme.
      */
@@ -120,7 +123,7 @@
      * Property that holds the max number of rows the UDDI should return on searches.
      */
     public static final String REGISTRY_UDDI_MAX_ROWS          = "org.jboss.soa.esb.registry.uddi.maxRows";
-    
+
     /**
      * The Registry interceptor class names.
      */
@@ -133,114 +136,138 @@
      * The cache validity period.
      */
     public static final String REGISTRY_CACHE_VALIDITY_PERIOD = "org.jboss.soa.esb.registry.cache.validityPeriod";
-	/*
-	 * Some default values.
-	 */
-	public static final String DEFAULT_PROPERTY_FILE                  = "jbossesb-properties.xml";
-	public static final String DEFAULT_HOST                           = "localhost";
-	public static final String DEFAULT_USERNAME                       = "";
-	public static final String DEFAULT_PASSWORD                       = "";
-	public static final String DEFAULT_PORT                           = "25";
-	public static final String DEFAULT_JNDI_CONTEXT_FACTORY           = "org.jnp.interfaces.NamingContextFactory";
-	public static final String DEFAULT_JNDI_PKG_PREFIX                = "org.jnp.interfaces";
+        /*
+         * Some default values.
+         */
+        public static final String DEFAULT_PROPERTY_FILE                  = "jbossesb-properties.xml";
+        public static final String DEFAULT_HOST                           = "localhost";
+        public static final String DEFAULT_USERNAME                       = "";
+        public static final String DEFAULT_PASSWORD                       = "";
+        public static final String DEFAULT_PORT                           = "25";
+        public static final String DEFAULT_JNDI_CONTEXT_FACTORY           = "org.jnp.interfaces.NamingContextFactory";
+        public static final String DEFAULT_JNDI_PKG_PREFIX                = "org.jnp.interfaces";
     public static final String DEFAULT_LOAD_BALANCER_POLICY           = "org.jboss.soa.esb.listeners.ha.FirstAvailable";
-	public static final String DEFAULT_REDELIVER_DLS_ON               = "true";
+        public static final String DEFAULT_REDELIVER_DLS_ON               = "true";
     public static final String DEFAULT_REGISTRY_CACHE_LIFE_MILLIS    = "60000";
-	/*
-	 * DatabaseMessageStore Persistence Store properties.
-	 */
-	public static final String MSG_STORE_DB_CONNECTION_URL 		= "org.jboss.soa.esb.persistence.db.connection.url";
-	public static final String MSG_STORE_DB_CONNECTION_USER 	= "org.jboss.soa.esb.persistence.db.user";
-	public static final String MSG_STORE_DB_CONNECTION_PWD 		= "org.jboss.soa.esb.persistence.db.pwd";
-	public static final String MSG_STORE_DB_TABLE_NAME 			= "org.jboss.soa.esb.persistence.db.table";
-	public static final String MSG_STORE_DB_JDBC_DRIVER			= "org.jboss.soa.esb.persistence.db.jdbc.driver";
-	public static final String MSG_STORE_DB_POOL_INITIAL_SIZE	= "org.jboss.soa.esb.persistence.db.pool.initial.size";
-	public static final String MSG_STORE_DB_POOL_MIN_SIZE		= "org.jboss.soa.esb.persistence.db.pool.min.size";
-	public static final String MSG_STORE_DB_POOL_MAX_SIZE		= "org.jboss.soa.esb.persistence.db.pool.max.size";
-	public static final String MSG_STORE_DB_POOL_TEST_TABLE		= "org.jboss.soa.esb.persistence.db.pool.test.table";
-	public static final String MSG_STORE_DB_POOL_TIMEOUT_MILLIS	= "org.jboss.soa.esb.persistence.db.pool.timeout.millis";
-	public static final String MSG_STORE_DB_CONN_MANAGER		= "org.jboss.soa.esb.persistence.db.conn.manager";
-	public static final String MSG_STORE_DB_DATASOURCE_NAME		= "org.jboss.soa.esb.persistence.db.datasource.name";
-	
-	/*
-	 * JcrMessageStore Persistence Store properties.
-	 */
-	public static final String MSG_STORE_JCR_JNDI_PATH			= "org.jboss.soa.esb.persistence.jcr.jndi.path";	
-	public static final String MSG_STORE_JCR_USERNAME			= "org.jboss.soa.esb.persistence.jcr.username";	
-	public static final String MSG_STORE_JCR_PASSWORD			= "org.jboss.soa.esb.persistence.jcr.password";	
-	public static final String MSG_STORE_JCR_ROOT_NODE_PATH		= "org.jboss.soa.esb.persistence.jcr.root.node.path";	
-	
-	/*
-	 * Some message metadata properties.
-	 */
-	
-	public static final String TRANSPORT_TYPE = "org.jboss.soa.esb.message.transport.type";
-	public static final String MESSAGE_SOURCE = "org.jboss.soa.esb.message.source";
-	public static final String MESSAGE_ENTRY_TIME = "org.jboss.soa.esb.message.time.dob"; // time born
-	public static final String MESSAGE_EXIT_TIME = "org.jboss.soa.esb.message.time.dod";  // time died
-	public static final String MESSAGE_BYTE_SIZE = "org.jboss.soa.esb.message.byte.size"; // size
-	
-	/** Message property name for original filename */
-	
-	public static final String ORIGINAL_FILE_NAME_MSG_PROP = "org.jboss.soa.esb.gateway.original.file.name";
-	public static final String ORIGINAL_QUEUE_NAME_MSG_PROP = "org.jboss.soa.esb.gateway.original.queue.name";
-	public static final String ORIGINAL_URL_PROP = "org.jboss.soa.esb.gateway.original.url";
-	
-	/*
-	 * Some gateway attachment names.
-	 */
-	
-	public static final String ORIGINAL_FILE = "org.jboss.soa.esb.gateway.file";
-	public static final String GATEWAY_CONFIG = "org.jboss.soa.esb.gateway.config";
-	
-	/*
-	 * Some JMS specific message element names.
-	 */
-	
-	public static final String JMS_MESSAGE_ID = "org.jboss.soa.esb.message.transport.jms.messageID";
-	public static final String JMS_NATIVE_MESSAGE_TYPE = "org.jboss.soa.esb.message.transport.jms.nativeMessageType"; // Text or Object
-	
-	/*
-	 * Filter properties should be identified by:
-	 * 
-	 * org.jboss.soa.esb.filter.<number>
-	 * 
-	 * and will be called in increasing order of <number>. Same <number> may be
-	 * called arbitrarily.
-	 */
+        /*
+         * DatabaseMessageStore Persistence Store properties.
+         */
+        public static final String MSG_STORE_DB_CONNECTION_URL          = "org.jboss.soa.esb.persistence.db.connection.url";
+        public static final String MSG_STORE_DB_CONNECTION_USER         = "org.jboss.soa.esb.persistence.db.user";
+        public static final String MSG_STORE_DB_CONNECTION_PWD          = "org.jboss.soa.esb.persistence.db.pwd";
+        public static final String MSG_STORE_DB_TABLE_NAME                      = "org.jboss.soa.esb.persistence.db.table";
+        public static final String MSG_STORE_DB_JDBC_DRIVER                     = "org.jboss.soa.esb.persistence.db.jdbc.driver";
+        public static final String MSG_STORE_DB_POOL_INITIAL_SIZE       = "org.jboss.soa.esb.persistence.db.pool.initial.size";
+        public static final String MSG_STORE_DB_POOL_MIN_SIZE           = "org.jboss.soa.esb.persistence.db.pool.min.size";
+        public static final String MSG_STORE_DB_POOL_MAX_SIZE           = "org.jboss.soa.esb.persistence.db.pool.max.size";
+        public static final String MSG_STORE_DB_POOL_TEST_TABLE         = "org.jboss.soa.esb.persistence.db.pool.test.table";
+        public static final String MSG_STORE_DB_POOL_TIMEOUT_MILLIS     = "org.jboss.soa.esb.persistence.db.pool.timeout.millis";
+        public static final String MSG_STORE_DB_CONN_MANAGER            = "org.jboss.soa.esb.persistence.db.conn.manager";
+        public static final String MSG_STORE_DB_DATASOURCE_NAME         = "org.jboss.soa.esb.persistence.db.datasource.name";
 
-	public static final String FILTER_NAME = "org.jboss.soa.esb.filter";
-	
-	/*
-	 * Some specific out-of-the-box filter configuration options.
-	 */
-	
-	public static final String MESSAGE_TRACE = "org.jboss.soa.esb.messagetrace"; // on or off
-	public static final String PER_MESSAGE_TRACE = "org.jboss.soa.esb.permessagetrace"; // on or off
-	
-	// Configuration options for the Naming Context pooling.
-	/**
-	 * The maximum pool size.
-	 */
-	public static final String NAMING_CONTEXT_POOL_SIZE = "org.jboss.soa.esb.namingcontext.poolsize" ;
-	/**
-	 * The maximum sleep period when waiting for a naming context, specified in seconds.
-	 */
+        /*
+         * JcrMessageStore Persistence Store properties.
+         */
+        public static final String MSG_STORE_JCR_JNDI_PATH                      = "org.jboss.soa.esb.persistence.jcr.jndi.path";
+        public static final String MSG_STORE_JCR_USERNAME                       = "org.jboss.soa.esb.persistence.jcr.username";
+        public static final String MSG_STORE_JCR_PASSWORD                       = "org.jboss.soa.esb.persistence.jcr.password";
+        public static final String MSG_STORE_JCR_ROOT_NODE_PATH         = "org.jboss.soa.esb.persistence.jcr.root.node.path";
+
+        /*
+         * Some message metadata properties.
+         */
+
+        public static final String TRANSPORT_TYPE = "org.jboss.soa.esb.message.transport.type";
+        public static final String MESSAGE_SOURCE = "org.jboss.soa.esb.message.source";
+        public static final String MESSAGE_ENTRY_TIME = "org.jboss.soa.esb.message.time.dob"; // time born
+        public static final String MESSAGE_EXIT_TIME = "org.jboss.soa.esb.message.time.dod";  // time died
+        public static final String MESSAGE_BYTE_SIZE = "org.jboss.soa.esb.message.byte.size"; // size
+
+        /** Message property name for original filename */
+
+        public static final String ORIGINAL_FILE_NAME_MSG_PROP = "org.jboss.soa.esb.gateway.original.file.name";
+        public static final String ORIGINAL_QUEUE_NAME_MSG_PROP = "org.jboss.soa.esb.gateway.original.queue.name";
+        public static final String ORIGINAL_URL_PROP = "org.jboss.soa.esb.gateway.original.url";
+
+        /*
+         * Some gateway attachment names.
+         */
+
+        public static final String ORIGINAL_FILE = "org.jboss.soa.esb.gateway.file";
+        public static final String GATEWAY_CONFIG = "org.jboss.soa.esb.gateway.config";
+
+        /*
+         * Some JMS specific message element names.
+         */
+
+        public static final String JMS_MESSAGE_ID = "org.jboss.soa.esb.message.transport.jms.messageID";
+        public static final String JMS_NATIVE_MESSAGE_TYPE = "org.jboss.soa.esb.message.transport.jms.nativeMessageType"; // Text or Object
+
+        /*
+         * Filter properties should be identified by:
+         *
+         * org.jboss.soa.esb.filter.<number>
+         *
+         * and will be called in increasing order of <number>. Same <number> may be
+         * called arbitrarily.
+         */
+
+        public static final String FILTER_NAME = "org.jboss.soa.esb.filter";
+
+        /*
+         * Some specific out-of-the-box filter configuration options.
+         */
+
+        public static final String MESSAGE_TRACE = "org.jboss.soa.esb.messagetrace"; // on or off
+        public static final String PER_MESSAGE_TRACE = "org.jboss.soa.esb.permessagetrace"; // on or off
+
+    /**
+     * The SecurityService Implementation class
+     */
+        public static final String SECURITY_SERVICE_IMPEMENTATION_CLASS         = "org.jboss.soa.esb.services.security.implementationClass";
+        public static final String SECURITY_SERVICE_CALLBACK_HANLDER_CLASS      = "org.jboss.soa.esb.services.security.callbackHandler";
+        public static final String SECURITY_SERVICE_CALLBACK                            = "org.jboss.soa.esb.services.security.callback_";
+        public static final String SECURITY_SERVICE_CONFIG_URL                          = "org.jboss.soa.esb.services.security.configUrl";
+        public static final String SECURITY_SERVICE_SEAL_ALGORITHM                      = "org.jboss.soa.esb.services.security.sealAlgorithm";
+        public static final String SECURITY_SERVICE_SEAL_KEYSIZE                        = "org.jboss.soa.esb.services.security.sealKeySize";
+
+        public static final String SECURITY_SERVICE_PRIVATE_KEYSTORE            = "org.jboss.soa.esb.services.security.privateKeystore";
+        public static final String SECURITY_SERVICE_PRIVATE_KEYSTORE_TYPE       = "org.jboss.soa.esb.services.security.privateKeystoreType";
+        public static final String SECURITY_SERVICE_PRIVATE_KEYSTORE_PASS       = "org.jboss.soa.esb.services.security.privateKeystorePassword";
+        public static final String SECURITY_SERVICE_PRIVATE_KEY_ALIAS       = "org.jboss.soa.esb.services.security.privateKeyAlias";
+        public static final String SECURITY_SERVICE_PRIVATE_KEY_PASS        = "org.jboss.soa.esb.services.security.privateKeyPassword";
+        public static final String SECURITY_SERVICE_PRIVATE_KEY_TRANSFORMATION = "org.jboss.soa.esb.services.security.privateKeyTransformation";
+
+        public static final String SECURITY_SERVICE_PUBLIC_KEYSTORE             = "org.jboss.soa.esb.services.security.publicKeystore";
+        public static final String SECURITY_SERVICE_PUBLIC_KEYSTORE_TYPE        = "org.jboss.soa.esb.services.security.publicKeystoreType";
+        public static final String SECURITY_SERVICE_PUBLIC_KEYSTORE_PASS        = "org.jboss.soa.esb.services.security.publicKeystorePassword";
+        public static final String SECURITY_SERVICE_PUBLIC_KEY_ALIAS        = "org.jboss.soa.esb.services.security.publicKeyAlias";
+        public static final String SECURITY_SERVICE_PUBLIC_KEY_PASS             = "org.jboss.soa.esb.services.security.publicKeyPassword";
+        public static final String SECURITY_SERVICE_PUBLIC_KEY_TRANSFORMATION = "org.jboss.soa.esb.services.security.publicKeyTransformation";
+
+        // Configuration options for the Naming Context pooling.
+        /**
+         * The maximum pool size.
+         */
+        public static final String NAMING_CONTEXT_POOL_SIZE = "org.jboss.soa.esb.namingcontext.poolsize" ;
+        /**
+         * The maximum sleep period when waiting for a naming context, specified in seconds.
+         */
         public static final String NAMING_CONTEXT_SLEEP_PERIOD = "org.jboss.soa.esb.namingcontext.sleepperiod" ;
         /**
          * The maximum number of retries when creating a naming context.
          */
         public static final String NAMING_CONTEXT_RETRY_COUNT = "org.jboss.soa.esb.namingcontext.retrycount" ;
         /**
-         * The JBoss JNDI provider URL. 
+         * The JBoss JNDI provider URL.
          */
         public static final String JBOSS_PROVIDER_URL = "localhost";
         /**
-         * The JBoss JNDI initial context factory. 
+         * The JBoss JNDI initial context factory.
          */
         public static final String JBOSS_INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory";
         /**
-         * The JBoss JNDI URL package prefix. 
+         * The JBoss JNDI URL package prefix.
          */
         public static final String JBOSS_URL_PKG_PREFIX = ""; //"org.jboss.naming:org.jnp.interfaces"
 }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java	2008-09-13 21:01:43 UTC (rev 22744)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java	2008-09-13 21:38:30 UTC (rev 22745)
@@ -35,8 +35,12 @@
 import org.apache.commons.net.ftp.FTPClient;
 import org.jboss.internal.soa.esb.util.FtpUtils;
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
 
 /**
  * Simplified FTP transfers
@@ -45,443 +49,486 @@
  * establish the FTP connection are provided at construction time and cannot
  * change during the lifetime of the object <br/>Hides low level details.
  * </p>
+ * 
+ * TODO why duplicate so much of FtpImpl.java?
  */
 
 public class FtpClientUtil
 {
-	public static final String PARMS_FTP_SERVER = "ftpServer";
+        public static final String PARMS_FTP_SERVER = "ftpServer";
 
-	public static final String PARMS_USER = "ftpUser";
+        public static final String PARMS_USER = "ftpUser";
 
-	public static final String PARMS_PASSWD = "ftpPassword";
+        public static final String PARMS_PASSWD = "ftpPassword";
 
-	public static final String PARMS_PORT = "ftpPort";
+        public static final String PARMS_PORT = "ftpPort";
 
-	public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
+        public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
 
-	public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
+        public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
 
-	public static final String PARMS_ASCII = "ftpAscii";
+        public static final String PARMS_ASCII = "ftpAscii";
 
-	public static final String PARMS_PASSIVE = "ftpPassive";
+        public static final String PARMS_PASSIVE = "ftpPassive";
 
-	private static final String TMP_SUFFIX = ".rosettaPart";
+        private static final String TMP_SUFFIX = ".rosettaPart";
+                
+        public enum XFER_TYPE
+        {
+                ascii, binary
+        }
 
-	public enum XFER_TYPE
-	{
-		ascii, binary
-	}
+        private ConfigTree m_oParms;
 
-	private ConfigTree m_oParms;
+        private String m_sFtpServer, m_sUser, m_sPasswd;
 
-	private String m_sFtpServer, m_sUser, m_sPasswd;
+        private String m_sRemoteDir, m_sLocalDir;
 
-	private String m_sRemoteDir, m_sLocalDir;
+        private int m_iPort;
 
-	private int m_iPort;
+        private boolean m_bPassive;
 
-	private boolean m_bPassive;
-
         private FTPClient m_oConn = new FTPClient();
 
         private boolean m_bAsciiTransferType ; 
+        
+        private int renameRetry;
 
-	public String getRemoteDir ()
-	{
-		return m_sRemoteDir;
-	}
+        public String getRemoteDir ()
+        {
+                return m_sRemoteDir;
+        }
 
-	/**
-	 * Checks validity and completeness of parameters, and keeps the info
-	 * internally for subsequent FTP requests
-	 * 
-	 * @param p_oP
-	 *            ConfigTree
-	 * @throws ConfigurationException :
-	 *             if parameters are invalid or incomplete
-	 *             <li>Parameters: (XML attributes at the root level) </li>
-	 *             <li> ftpServer = name or IP of FTP server </li>
-	 *             <li> ftpUser = login ID for server </li>
-	 *             <li> ftpPassword </li>
-	 *             <li> localDirURI = absolute path in the local filesystem
-	 *             </li>
-	 *             <li> remoteDirURI = remote path is relative to ftp user home
-	 *             in remote computer </li>
-	 * @throws RemoteFileSystemException
-	 */
+        /**
+         * Checks validity and completeness of parameters, and keeps the info
+         * internally for subsequent FTP requests
+         * 
+         * @param p_oP
+         *            ConfigTree
+         * @throws ConfigurationException :
+         *             if parameters are invalid or incomplete
+         *             <li>Parameters: (XML attributes at the root level) </li>
+         *             <li> ftpServer = name or IP of FTP server </li>
+         *             <li> ftpUser = login ID for server </li>
+         *             <li> ftpPassword </li>
+         *             <li> localDirURI = absolute path in the local filesystem
+         *             </li>
+         *             <li> remoteDirURI = remote path is relative to ftp user home
+         *             in remote computer </li>
+         * @throws RemoteFileSystemException
+         */
 
-	public FtpClientUtil (ConfigTree p_oP, boolean p_bConnect) throws RemoteFileSystemException, ConfigurationException
-	{
-		m_oParms = p_oP;
-		initialize(p_bConnect);
-	} // _________________________________
+        public FtpClientUtil (ConfigTree p_oP, boolean p_bConnect) throws RemoteFileSystemException, ConfigurationException
+        {
+                m_oParms = p_oP;
+                initialize(p_bConnect);
+        } // _________________________________
 
-	public FtpClientUtil (List<KeyValuePair> attribs, boolean connect)
-			throws RemoteFileSystemException, ConfigurationException
-	{
-		m_oParms = new ConfigTree("fromProps");
-		for (KeyValuePair oCurr : attribs)
-			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
-		initialize(connect);
-	} // __________________________________
+        public FtpClientUtil (List<KeyValuePair> attribs, boolean connect)
+                        throws RemoteFileSystemException, ConfigurationException
+        {
+                m_oParms = new ConfigTree("fromProps");
+                for (KeyValuePair oCurr : attribs)
+                        m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
+                initialize(connect);
+        } // __________________________________
 
-	private void initialize (boolean bConnect) throws RemoteFileSystemException, ConfigurationException
-	{
-		checkParms();
-		
-		try
-		{
-			if (bConnect)
-			{
-				if (m_iPort > 0)
-				{
-				    m_oConn.connect(m_sFtpServer, m_iPort) ;
-				}
-				else
-				{
-				    m_oConn.connect(m_sFtpServer) ;
-				}
+        private void initialize (boolean bConnect) throws RemoteFileSystemException, ConfigurationException
+        {
+                checkParms();
+                
+                try
+                {
+                        if (bConnect)
+                        {
+                                if (m_iPort > 0)
+                                {
+                                    m_oConn.connect(m_sFtpServer, m_iPort) ;
+                                }
+                                else
+                                {
+                                    m_oConn.connect(m_sFtpServer) ;
+                                }
 
-				
-				if (!m_oConn.isConnected())
-					throw new RemoteFileSystemException("Can't connect to FTP server");
-				if (!m_oConn.login(m_sUser, m_sPasswd))
-				{
-				    m_oConn.logout() ;
-				    throw new RemoteFileSystemException("Remote login failed: " + m_oConn.getReplyString());
-				}
-				m_oConn.setFileType(m_bAsciiTransferType ? FTP.ASCII_FILE_TYPE : FTP.BINARY_FILE_TYPE) ;
-				if (m_bPassive)
-				{
-					m_oConn.enterLocalPassiveMode() ;
-				}
-			}
-		}
-		catch (IOException ioe)
-		{
-			if (m_oConn.isConnected())
-			{
-			    try
-			    {
-			        m_oConn.disconnect() ;
-			    }
-			    catch (final IOException ioe2) {} // ignore
-			}
-			throw new RemoteFileSystemException(ioe);
-		}
-	} // __________________________________
+                                
+                                if (!m_oConn.isConnected())
+                                        throw new RemoteFileSystemException("Can't connect to FTP server");
+                                if (!m_oConn.login(m_sUser, m_sPasswd))
+                                {
+                                    m_oConn.logout() ;
+                                    throw new RemoteFileSystemException("Remote login failed: " + m_oConn.getReplyString());
+                                }
+                                m_oConn.setFileType(m_bAsciiTransferType ? FTP.ASCII_FILE_TYPE : FTP.BINARY_FILE_TYPE) ;
+                                if (m_bPassive)
+                                {
+                                        m_oConn.enterLocalPassiveMode() ;
+                                }
+                        }
+                }
+                catch (IOException ioe)
+                {
+                        if (m_oConn.isConnected())
+                        {
+                            try
+                            {
+                                m_oConn.disconnect() ;
+                            }
+                            catch (final IOException ioe2) {} // ignore
+                        }
+                        throw new RemoteFileSystemException(ioe);
+                }
+        } // __________________________________
 
-	/**
-	 * Terminates ftp session and frees resources
-	 * <li>Well behaved programs should make sure to call this method </li>
-	 */
-	public void quit ()
-	{
-		if (null != m_oConn) try
-		{
-			m_oConn.quit();
-			m_oConn.disconnect();
-		}
-		catch (Exception e)
-		{
-		}
-	} // _________________________________
+        /**
+         * Terminates ftp session and frees resources
+         * <li>Well behaved programs should make sure to call this method </li>
+         */
+        public void quit ()
+        {
+                if (null != m_oConn) try
+                {
+                        m_oConn.quit();
+                        m_oConn.disconnect();
+                }
+                catch (Exception e)
+                {
+                }
+        } // _________________________________
 
-	/**
-	 * Deletes specified file in remote directory
-	 * 
-	 * @param p_sFile
-	 *            String : filename to delete. Method will attempt to delete
-	 *            file with rightmost node of argument within remote directory
-	 *            specified in 'remoteDirURI'
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             deleted in remote directory
-	 */
-	public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException
-	{
-		try
-		{
-			changeRemoteDirectory() ;
-			if (!m_oConn.deleteFile(p_sFile))
-			{
-			    throw new RemoteFileSystemException("Failed to delete remote file: " + m_oConn.getReplyString());
-			}
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
+        /**
+         * Deletes specified file in remote directory
+         * 
+         * @param p_sFile
+         *            String : filename to delete. Method will attempt to delete
+         *            file with rightmost node of argument within remote directory
+         *            specified in 'remoteDirURI'
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             deleted in remote directory
+         */
+        public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException
+        {
+                try
+                {
+                        changeRemoteDirectory() ;
+                        if (!m_oConn.deleteFile(p_sFile))
+                        {
+                            throw new RemoteFileSystemException("Failed to delete remote file: " + m_oConn.getReplyString());
+                        }
+                }
+                catch (IOException ex)
+                {
+                        throw new RemoteFileSystemException(ex);
+                }
+        } // _________________________________
 
-	public void remoteDelete (File p_oFile) throws RemoteFileSystemException
-	{
-		try
-		{
-			changeRemoteDirectory() ;
-			if (!m_oConn.deleteFile(p_oFile.getName()))
-			{
-			    throw new RemoteFileSystemException("Failed to delete remote file: " + m_oConn.getReplyString());
-			}
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
+        public void remoteDelete (File p_oFile) throws RemoteFileSystemException
+        {
+                try
+                {
+                        changeRemoteDirectory() ;
+                        if (!m_oConn.deleteFile(p_oFile.getName()))
+                        {
+                            throw new RemoteFileSystemException("Failed to delete remote file: " + m_oConn.getReplyString());
+                        }
+                }
+                catch (IOException ex)
+                {
+                        throw new RemoteFileSystemException(ex);
+                }
+        } // _________________________________
 
-	/**
-	 * Gets the list of files in the remote directory that end with arg0
-	 * 
-	 * @param p_sSuffix
-	 *            String : retrieve only files that end with that suffix - all
-	 *            files if null
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or problems
-	 *             encountered
-	 */
-	public String[] getFileListFromRemoteDir (String p_sSuffix)
-			throws RemoteFileSystemException
-	{
-		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
-		
-		try
-		{
-			changeRemoteDirectory() ;
-			return m_oConn.listNames(sSuffix);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
+        /**
+         * Gets the list of files in the remote directory that end with arg0
+         * 
+         * @param p_sSuffix
+         *            String : retrieve only files that end with that suffix - all
+         *            files if null
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or problems
+         *             encountered
+         */
+        public String[] getFileListFromRemoteDir (String p_sSuffix)
+                        throws RemoteFileSystemException
+        {
+                String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
+                
+                try
+                {
+                        changeRemoteDirectory() ;
+                        return m_oConn.listNames(sSuffix);
+                }
+                catch (IOException ex)
+                {
+                        throw new RemoteFileSystemException(ex);
+                }
+        } // _________________________________
 
-	/**
-	 * Change remote directory
-	 * 
-	 * @param p_sDir
-	 *            String : directory to set
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or problems
-	 *             encountered
-	 */
-	public void setRemoteDir (String p_sDir) throws RemoteFileSystemException
-	{
-		m_sRemoteDir = p_sDir ;
-	} // _________________________________
+        /**
+         * Change remote directory
+         * 
+         * @param p_sDir
+         *            String : directory to set
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or problems
+         *             encountered
+         */
+        public void setRemoteDir (String p_sDir) throws RemoteFileSystemException
+        {
+                m_sRemoteDir = p_sDir ;
+        } // _________________________________
 
-	/**
-	 * Renames specified file in remote directory to specified new name
-	 * 
-	 * @param p_sFrom
-	 *            String : filename to rename
-	 * @param p_sTo
-	 *            String : new filename
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             renamed to new name in remote directory
-	 *             <li>Method will attempt to rename file with rightmost node
-	 *             of argument within remote directory specified in
-	 *             'remoteDirURI', to new name inside the SAME remote directory
-	 */
-	public void renameInRemoteDir (String p_sFrom, String p_sTo)
-			throws RemoteFileSystemException
-	{
-		try
-		{
-			changeRemoteDirectory() ;
-			if (!m_oConn.rename(p_sFrom, p_sTo))
-			{
-			    throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
-			}
-		}
-		catch (final IOException ioe)
-		{
-			throw new RemoteFileSystemException(ioe);
-		}
-	} // _________________________________
+        /**
+         * Renames specified file in remote directory to specified new name
+         * 
+         * @param p_sFrom
+         *            String : filename to rename
+         * @param p_sTo
+         *            String : new filename
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             renamed to new name in remote directory
+         *             <li>Method will attempt to rename file with rightmost node
+         *             of argument within remote directory specified in
+         *             'remoteDirURI', to new name inside the SAME remote directory
+         */
+        public void renameInRemoteDir (String p_sFrom, String p_sTo)
+                        throws RemoteFileSystemException
+        {
+                try
+                {
+                        changeRemoteDirectory() ;
+                        if (!m_oConn.rename(p_sFrom, p_sTo))
+                        {
+                            throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
+                        }
+                }
+                catch (final IOException ioe)
+                {
+                        throw new RemoteFileSystemException(ioe);
+                }
+        } // _________________________________
 
-	public void remoteRename (File p_oFrom, File p_oTo) throws RemoteFileSystemException
-	{
-		try
-		{
-			if (!m_oConn.rename(FtpClientUtil.fileToFtpString(p_oFrom),
-			        FtpUtils.fileToFtpString(p_oTo)))
-			{
-			    throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
-			}
-		}
-		catch (IOException ioe)
-		{
-			throw new RemoteFileSystemException(ioe);
-		}
-	} // _________________________________
+        public void remoteRename (File p_oFrom, File p_oTo) throws RemoteFileSystemException
+        {
+                try
+                {
+                        if (!m_oConn.rename(FtpClientUtil.fileToFtpString(p_oFrom),
+                                FtpUtils.fileToFtpString(p_oTo)))
+                        {
+                            throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
+                        }
+                }
+                catch (IOException ioe)
+                {
+                        throw new RemoteFileSystemException(ioe);
+                }
+        } // _________________________________
 
-	/**
-	 * Uploads specified file from local directory (localDirURI) to remote
-	 * directory (remoteDirURI)
-	 * 
-	 * @param p_oFile
-	 *            String : filename to upload
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             uploaded
-	 *             <li> local file will be renamed during transfer
-	 *             ('.xferNotReady' appended to name)</li>
-	 *             <li> upon successful completion. the suffix '.xferDone' will
-	 *             be appended to the original filename </li>
-	 */
-	public void uploadFile (File p_oFile, String p_sRemoteName)
-			throws RemoteFileSystemException
-	{
-		try
-		{
-			changeRemoteDirectory() ;
-			final String sRemoteTmp = p_sRemoteName + TMP_SUFFIX ;
-			
-			final OutputStream os = m_oConn.storeFileStream(sRemoteTmp) ;
-			try
-			{
-			    final FileInputStream fis = new FileInputStream(p_oFile) ;
-			    try
-			    {
-			        copyStream(fis, os) ;
-			    }
-			    finally
-			    {
-			        fis.close() ;
-			    }
-			}
-			finally
-			{
-			    os.flush() ;
-			    os.close() ;
-			}
-			if (!m_oConn.completePendingCommand())
-			{
-			    throw new RemoteFileSystemException("Failed to upload contents: " + m_oConn.getReplyString()) ;
-			}
-			if (!m_oConn.rename(sRemoteTmp, p_sRemoteName))
-			{
-			    throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
-			}
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
+        /**
+         * Uploads specified file from local directory (localDirURI) to remote
+         * directory (remoteDirURI)
+         * 
+         * @param p_oFile
+         *            String : filename to upload
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             uploaded
+         *             <li> local file will be renamed during transfer
+         *             ('.xferNotReady' appended to name)</li>
+         *             <li> upon successful completion. the suffix '.xferDone' will
+         *             be appended to the original filename </li>
+         */
+        public void uploadFile (File p_oFile, String p_sRemoteName)
+                        throws RemoteFileSystemException
+        {
+                try
+                {
+                        changeRemoteDirectory() ;
+                        final String sRemoteTmp = p_sRemoteName + TMP_SUFFIX ;
+                        
+                        final OutputStream os = m_oConn.storeFileStream(sRemoteTmp) ;
+                        try
+                        {
+                            final FileInputStream fis = new FileInputStream(p_oFile) ;
+                            try
+                            {
+                                copyStream(fis, os) ;
+                            }
+                            finally
+                            {
+                                fis.close() ;
+                            }
+                        }
+                        finally
+                        {
+                            os.flush() ;
+                            os.close() ;
+                        }
+                        if (!m_oConn.completePendingCommand())
+                        {
+                            throw new RemoteFileSystemException("Failed to upload contents: " + m_oConn.getReplyString()) ;
+                        }
+                        
+                        boolean retryProblem = true;  // https://jira.jboss.org/jira/browse/JBESB-1995
 
-	/**
-	 * Downloads specified file from remote directory (remoteDirURI) to local
-	 * directory (localDirURI)
-	 * 
-	 * @param p_sFile
-	 *            String : filename to download
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             downloaded
-	 *             <li> local file is assigned a temporary name during transfer
-	 *             </li>
-	 *             <li> upon successful completion, local temporary file will be
-	 *             renamed to name specified in argument, and suffix '.xferDone'
-	 *             will be appended to the original filename in the remote
-	 *             directory </li>
-	 */
-	public void downloadFile (String p_sFile, String p_sFinalName)
-			throws RemoteFileSystemException
-	{
-		try
-		{
-			final File to = new File(p_sFinalName) ;
-			final File oLocalDir = new File(m_sLocalDir);
-			final File oNew = (to.isAbsolute() ? to : new File(oLocalDir, p_sFinalName)) ;
-			if (oNew.exists())
-			    oNew.delete();
-			
-			final File toTmp = new File(p_sFinalName + TMP_SUFFIX) ;
-			final File oNewTmp = (toTmp.isAbsolute() ? toTmp : new File(oLocalDir, p_sFinalName + TMP_SUFFIX)) ;
-			if (oNewTmp.exists())
-			    oNewTmp.delete();
-			
-			changeRemoteDirectory() ;
-			final InputStream is = m_oConn.retrieveFileStream(p_sFile) ;
-			if (is == null)
-			{
-			    throw new RemoteFileSystemException("Could not download file: " + m_oConn.getReplyString());
-			}
-			
-			try
-			{
-			    final FileOutputStream fos = new FileOutputStream(oNewTmp) ;
-			    try
-			    {
-			        copyStream(is, fos) ;
-			    }
-			    finally
-			    {
-			        fos.close() ;
-			    }
-			}
-			finally
-			{
-			    is.close() ;
-			}
-			if (!m_oConn.completePendingCommand())
-			{
-			    oNewTmp.delete() ;
-			    throw new RemoteFileSystemException("Failed to download contents: " + m_oConn.getReplyString()) ;
-			}
-			FileUtil.renameTo(oNewTmp, oNew);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
+                        for (int i = 0; i < renameRetry; i++)
+                        {
+                            if (m_oConn.rename(sRemoteTmp, p_sRemoteName))
+                            {
+                                retryProblem = false;
 
-	private void checkParms () throws ConfigurationException
-	{
-		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
-		if (null == m_sFtpServer)
-			throw new ConfigurationException("No FTP server specified");
+                                break;
+                            }
+                            else
+                            {
+                                try
+                                {
+                                    Thread.sleep(RemoteFileSystem.DEFAULT_RENAME_RETRY_TIMEOUT);
+                                }
+                                catch (final Exception ex)
+                                {
+                                }
+                            }
+                        }
 
-		m_sUser = m_oParms.getAttribute(PARMS_USER);
-		if (null == m_sUser)
-			throw new ConfigurationException("No username specified for FTP");
+                        if (retryProblem)
+                            throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
+                }
+                catch (IOException ex)
+                {
+                        throw new RemoteFileSystemException(ex);
+                }
+        } // _________________________________
 
-		m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
-		if (null == m_sPasswd)
-			throw new ConfigurationException("No password specified for FTP");
+        /**
+         * Downloads specified file from remote directory (remoteDirURI) to local
+         * directory (localDirURI)
+         * 
+         * @param p_sFile
+         *            String : filename to download
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             downloaded
+         *             <li> local file is assigned a temporary name during transfer
+         *             </li>
+         *             <li> upon successful completion, local temporary file will be
+         *             renamed to name specified in argument, and suffix '.xferDone'
+         *             will be appended to the original filename in the remote
+         *             directory </li>
+         */
+        public void downloadFile (String p_sFile, String p_sFinalName)
+                        throws RemoteFileSystemException
+        {
+                try
+                {
+                        final File to = new File(p_sFinalName) ;
+                        final File oLocalDir = new File(m_sLocalDir);
+                        final File oNew = (to.isAbsolute() ? to : new File(oLocalDir, p_sFinalName)) ;
+                        if (oNew.exists())
+                            oNew.delete();
+                        
+                        final File toTmp = new File(p_sFinalName + TMP_SUFFIX) ;
+                        final File oNewTmp = (toTmp.isAbsolute() ? toTmp : new File(oLocalDir, p_sFinalName + TMP_SUFFIX)) ;
+                        if (oNewTmp.exists())
+                            oNewTmp.delete();
+                        
+                        changeRemoteDirectory() ;
+                        final InputStream is = m_oConn.retrieveFileStream(p_sFile) ;
+                        if (is == null)
+                        {
+                            throw new RemoteFileSystemException("Could not download file: " + m_oConn.getReplyString());
+                        }
+                        
+                        try
+                        {
+                            final FileOutputStream fos = new FileOutputStream(oNewTmp) ;
+                            try
+                            {
+                                copyStream(is, fos) ;
+                            }
+                            finally
+                            {
+                                fos.close() ;
+                            }
+                        }
+                        finally
+                        {
+                            is.close() ;
+                        }
+                        if (!m_oConn.completePendingCommand())
+                        {
+                            oNewTmp.delete() ;
+                            throw new RemoteFileSystemException("Failed to download contents: " + m_oConn.getReplyString()) ;
+                        }
+                        FileUtil.renameTo(oNewTmp, oNew);
+                }
+                catch (IOException ex)
+                {
+                        throw new RemoteFileSystemException(ex);
+                }
+        } // _________________________________
 
-		m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
-		if (null == m_sRemoteDir) 
-			m_sRemoteDir = "";
+        private void checkParms () throws ConfigurationException
+        {
+                m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
+                if (null == m_sFtpServer)
+                        throw new ConfigurationException("No FTP server specified");
 
-		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
-		if (null == m_sLocalDir) 
-			m_sLocalDir = ".";
+                m_sUser = m_oParms.getAttribute(PARMS_USER);
+                if (null == m_sUser)
+                        throw new ConfigurationException("No username specified for FTP");
 
-		String sAux = m_oParms.getAttribute(PARMS_PORT);
-		m_iPort = (null == sAux) ? 21 : Integer.parseInt(sAux);
+                m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
+                if (null == m_sPasswd)
+                        throw new ConfigurationException("No password specified for FTP");
 
-		boolean bAscii = false;
-		sAux = m_oParms.getAttribute(PARMS_ASCII);
-		
-		if (null != sAux) 
-			bAscii = Boolean.parseBoolean(sAux);
-		
-		m_bAsciiTransferType = bAscii;
+                m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
+                if (null == m_sRemoteDir) 
+                        m_sRemoteDir = "";
 
-		m_bPassive = false;
-		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
-		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
-	} // __________________________________
+                m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
+                if (null == m_sLocalDir) 
+                        m_sLocalDir = ".";
 
-	public static String fileToFtpString (File p_oF)
-	{
-		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
-	} // ________________________________
+                String sAux = m_oParms.getAttribute(PARMS_PORT);
+                m_iPort = (null == sAux) ? 21 : Integer.parseInt(sAux);
+
+                boolean bAscii = false;
+                sAux = m_oParms.getAttribute(PARMS_ASCII);
+                
+                if (null != sAux) 
+                        bAscii = Boolean.parseBoolean(sAux);
+                
+                m_bAsciiTransferType = bAscii;
+
+                m_bPassive = false;
+                sAux = m_oParms.getAttribute(PARMS_PASSIVE);
+                m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
+                
+                String renameRetryString = ModulePropertyManager.getPropertyManager(
+                        ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+                        Environment.FTP_RENAME_RETRY, null);
+
+                if (renameRetryString != null)
+                {
+                    try
+                    {
+                        renameRetry = Integer.parseInt(renameRetryString);
+                    }
+                    catch (Exception ex)
+                    {
+                        throw new ConfigurationException("Invalid rename retry limit: "+renameRetryString);
+                    }
+                }
+                else
+                    renameRetry = RemoteFileSystem.DEFAULT_RENAME_RETRY_NUMBER;
+        } // __________________________________
+
+        public static String fileToFtpString (File p_oF)
+        {
+                return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
+        } // ________________________________
         
         private void changeRemoteDirectory()
             throws IOException, RemoteFileSystemException

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java	2008-09-13 21:01:43 UTC (rev 22744)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java	2008-09-13 21:38:30 UTC (rev 22745)
@@ -28,143 +28,147 @@
 public interface RemoteFileSystem
 {
 
-	public static final String FTP_PROTOCOL = "ftp";
+        public static final String FTP_PROTOCOL = "ftp";
 
-	public static final String SFTP_PROTOCOL = "sftp";
+        public static final String SFTP_PROTOCOL = "sftp";
 
-	public static final String FTPS_PROTOCOL = "ftps";
+        public static final String FTPS_PROTOCOL = "ftps";
 
-	public static final String PARMS_PROTOCOL = "protocol";
+        public static final String PARMS_PROTOCOL = "protocol";
 
-	public static final String PARMS_FTP_SERVER = "ftpServer";
+        public static final String PARMS_FTP_SERVER = "ftpServer";
 
-	public static final String PARMS_USER = "ftpUser";
+        public static final String PARMS_USER = "ftpUser";
 
-	public static final String PARMS_PASSWD = "ftpPassword";
+        public static final String PARMS_PASSWD = "ftpPassword";
 
-	public static final String PARMS_PORT = "ftpPort";
+        public static final String PARMS_PORT = "ftpPort";
 
-	public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
+        public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
 
-	public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
+        public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
 
-	public static final String PARMS_ASCII = "ftpAscii";
+        public static final String PARMS_ASCII = "ftpAscii";
 
-	public static final String PARMS_PASSIVE = "ftpPassive";
+        public static final String PARMS_PASSIVE = "ftpPassive";
 
-	public static final String PARMS_CERTIFICATE = "certificate";
+        public static final String PARMS_CERTIFICATE = "certificate";
 
-	public static final String PARMS_CERTIFICATE_NAME = "certificateName";
+        public static final String PARMS_CERTIFICATE_NAME = "certificateName";
 
-	public static final String PARMS_PASSPHRASE = "passphrase";
-	
-	public String getRemoteDir ();
+        public static final String PARMS_PASSPHRASE = "passphrase";
+        
+        public static final int DEFAULT_RENAME_RETRY_NUMBER = 10; // default retries
+        
+        public static final int DEFAULT_RENAME_RETRY_TIMEOUT = 1000;  // 1 second
+        
+        public String getRemoteDir ();
 
-	/**
-	 * Terminates ftp session and frees resources
-	 * <li>Well behaved programs should make sure to call this method </li>
-	 */
-	public void quit (); // _________________________________
+        /**
+         * Terminates ftp session and frees resources
+         * <li>Well behaved programs should make sure to call this method </li>
+         */
+        public void quit (); // _________________________________
 
-	/**
-	 * Deletes specified file in remote directory
-	 * 
-	 * @param p_sFile
-	 *            String : filename to delete. Method will attempt to delete
-	 *            file with rightmost node of argument within remote directory
-	 *            specified in 'remoteDirURI'
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             deleted in remote directory
-	 */
-	public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException; // _________________________________
+        /**
+         * Deletes specified file in remote directory
+         * 
+         * @param p_sFile
+         *            String : filename to delete. Method will attempt to delete
+         *            file with rightmost node of argument within remote directory
+         *            specified in 'remoteDirURI'
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             deleted in remote directory
+         */
+        public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException; // _________________________________
 
-	public void remoteDelete (File p_oFile) throws RemoteFileSystemException; // _________________________________
+        public void remoteDelete (File p_oFile) throws RemoteFileSystemException; // _________________________________
 
-	/**
-	 * Gets the list of files in the remote directory that end with arg0
-	 * 
-	 * @param p_sSuffix
-	 *            String : retrieve only files that end with that suffix - all
-	 *            files if null
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or problems
-	 *             encountered
-	 */
-	public String[] getFileListFromRemoteDir (String p_sSuffix)
-			throws IOException, RemoteFileSystemException; // _________________________________
+        /**
+         * Gets the list of files in the remote directory that end with arg0
+         * 
+         * @param p_sSuffix
+         *            String : retrieve only files that end with that suffix - all
+         *            files if null
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or problems
+         *             encountered
+         */
+        public String[] getFileListFromRemoteDir (String p_sSuffix)
+                        throws IOException, RemoteFileSystemException; // _________________________________
 
-	/**
-	 * Change remote directory
-	 * 
-	 * @param p_sDir
-	 *            String : directory to set
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or problems
-	 *             encountered
-	 */
-	public void setRemoteDir (String p_sDir) throws RemoteFileSystemException; // _________________________________
+        /**
+         * Change remote directory
+         * 
+         * @param p_sDir
+         *            String : directory to set
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or problems
+         *             encountered
+         */
+        public void setRemoteDir (String p_sDir) throws RemoteFileSystemException; // _________________________________
 
-	/**
-	 * Renames specified file in remote directory to specified new name
-	 * 
-	 * @param p_sFrom
-	 *            String : filename to rename
-	 * @param p_sTo
-	 *            String : new filename
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             renamed to new name in remote directory
-	 *             <li>Method will attempt to rename file with rightmost node
-	 *             of argument within remote directory specified in
-	 *             'remoteDirURI', to new name inside the SAME remote directory
-	 */
-	public void renameInRemoteDir (String p_sFrom, String p_sTo)
-			throws RemoteFileSystemException; // _________________________________
+        /**
+         * Renames specified file in remote directory to specified new name
+         * 
+         * @param p_sFrom
+         *            String : filename to rename
+         * @param p_sTo
+         *            String : new filename
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             renamed to new name in remote directory
+         *             <li>Method will attempt to rename file with rightmost node
+         *             of argument within remote directory specified in
+         *             'remoteDirURI', to new name inside the SAME remote directory
+         */
+        public void renameInRemoteDir (String p_sFrom, String p_sTo)
+                        throws RemoteFileSystemException; // _________________________________
 
-	/**
-	 * 
-	 * @param p_oFrom
-	 * @param p_oTo
-	 * @throws IOException if file not found.
-	 * @throws RemoteFileSystemException
-	 */
-	public void remoteRename (File p_oFrom, File p_oTo) throws IOException, RemoteFileSystemException; // _________________________________
+        /**
+         * 
+         * @param p_oFrom
+         * @param p_oTo
+         * @throws IOException if file not found.
+         * @throws RemoteFileSystemException
+         */
+        public void remoteRename (File p_oFrom, File p_oTo) throws IOException, RemoteFileSystemException; // _________________________________
 
-	/**
-	 * Uploads specified file from local directory (localDirURI) to remote
-	 * directory (remoteDirURI)
-	 * 
-	 * @param p_oFile
-	 *            String : filename to upload
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             uploaded
-	 *             <li> local file will be renamed during transfer
-	 *             ('.xferNotReady' appended to name)</li>
-	 *             <li> upon successful completion. the suffix '.xferDone' will
-	 *             be appended to the original filename </li>
-	 */
-	public void uploadFile (File p_oFile, String p_sRemoteName)
-			throws RemoteFileSystemException; // _________________________________
+        /**
+         * Uploads specified file from local directory (localDirURI) to remote
+         * directory (remoteDirURI)
+         * 
+         * @param p_oFile
+         *            String : filename to upload
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             uploaded
+         *             <li> local file will be renamed during transfer
+         *             ('.xferNotReady' appended to name)</li>
+         *             <li> upon successful completion. the suffix '.xferDone' will
+         *             be appended to the original filename </li>
+         */
+        public void uploadFile (File p_oFile, String p_sRemoteName)
+                        throws RemoteFileSystemException; // _________________________________
 
-	/**
-	 * Downloads specified file from remote directory (remoteDirURI) to local
-	 * directory (localDirURI)
-	 * 
-	 * @param p_sFile
-	 *            String : filename to download
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             downloaded
-	 *             <li> local file is assigned a temporary name during transfer
-	 *             </li>
-	 *             <li> upon successful completion, local temporary file will be
-	 *             renamed to name specified in argument, and suffix '.xferDone'
-	 *             will be appended to the original filename in the remote
-	 *             directory </li>
-	 */
-	public void downloadFile (String p_sFile, String p_sFinalName)
-			throws IOException, RemoteFileSystemException; // _________________________________
+        /**
+         * Downloads specified file from remote directory (remoteDirURI) to local
+         * directory (localDirURI)
+         * 
+         * @param p_sFile
+         *            String : filename to download
+         * @throws RemoteFileSystemException :
+         *             if ftp connection cannot be established, or file cannot be
+         *             downloaded
+         *             <li> local file is assigned a temporary name during transfer
+         *             </li>
+         *             <li> upon successful completion, local temporary file will be
+         *             renamed to name specified in argument, and suffix '.xferDone'
+         *             will be appended to the original filename in the remote
+         *             directory </li>
+         */
+        public void downloadFile (String p_sFile, String p_sFinalName)
+                        throws IOException, RemoteFileSystemException; // _________________________________
 
 }
\ No newline at end of file




More information about the jboss-svn-commits mailing list