[esb-issues] [JBoss JIRA] Commented: (JBESB-2524) RemoteGatewayListener ignores local FTP location

Tom Fennelly (JIRA) jira-events at lists.jboss.org
Fri Jun 26 06:52:56 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBESB-2524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12473907#action_12473907 ] 

Tom Fennelly commented on JBESB-2524:
-------------------------------------

What was the intention of the ftpLocalDir setting?  From what I can see in the code... there's no config option (in the XSD) to specify the ftpLocalDir configTree parameter, but that was probably never the intention.  It doesn't seem to be getting set on the FTP EPR (via ListenerUtil.assembleEpr).  Has anyone an idea what it was intended for, considering that the FTPGateway has been working away (in some capacity) without it?

> RemoteGatewayListener ignores local FTP location
> ------------------------------------------------
>
>                 Key: JBESB-2524
>                 URL: https://jira.jboss.org/jira/browse/JBESB-2524
>             Project: JBoss ESB
>          Issue Type: Patch
>      Security Level: Public(Everyone can see) 
>          Components: Transports
>    Affects Versions: 4.4
>            Reporter: George Gastaldi
>            Priority: Trivial
>             Fix For: 4.6
>
>
> The class RemoteGatewayListener does an ugly checking for the temporary directory and ignores any attempt to define a local directory:
> This is the actual code :
> ..
> 	protected void checkMyParms() throws ConfigurationException, RegistryException, GatewayException
> 	{
> 		try
> 		{
> 			File temp = File.createTempFile("FTPdown", ".tmp");
> 			temp.delete();
> 			String localDir = temp.getParent();
> 			if (null==localDir)
> 				localDir=new File("").getAbsolutePath();
> 			config.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, localDir);
> 			final String remoteDir = config.getAttribute(ListenerTagNames.FILE_INPUT_DIR_TAG) ;
> 			config.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR, remoteDir);
> 			EPR epr = ListenerUtil.assembleEpr(config);
> 			if (epr instanceof FTPEpr)  {
> 				FTPEpr ftpEpr = (FTPEpr) epr;
> 				RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
> 				rfs.quit();
> 			} else {
> 				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
> 			}
> 		}
> 		catch (IOException ex)
> 		{
> 			throw new ConfigurationException(ex);
> 		}
> 		catch (RemoteFileSystemException ex)
> 		{
> 			throw new ConfigurationException(ex);
> 		}
> 		
> 	}
> ...
> The Listener should check first if a path has been defined before attempting to discover the local directory.
> BTW, the first lines could be replaced by System.getProperty("java.io.tmpdir"), instead of creating and deleting a file (expensive unnecessary operation).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the esb-issues mailing list