[jboss-svn-commits] JBL Code SVN: r8109 - in labs/jbossesb/workspace/b_georges/product: core/listeners/src/org/jboss/soa/esb/listeners/gateway core/rosetta/src/org/jboss/internal/soa/esb/util core/rosetta/src/org/jboss/soa/esb/addressing/eprs core/rosetta/src/org/jboss/soa/esb/util docs

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Dec 6 16:11:45 EST 2006


Author: b_georges
Date: 2006-12-06 16:11:37 -0500 (Wed, 06 Dec 2006)
New Revision: 8109

Added:
   labs/jbossesb/workspace/b_georges/product/docs/Thumbs.db
Modified:
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/FtpGatewayListener.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
Log:
Some progress...

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/FtpGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/FtpGatewayListener.java	2006-12-06 20:11:18 UTC (rev 8108)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/FtpGatewayListener.java	2006-12-06 21:11:37 UTC (rev 8109)
@@ -28,14 +28,16 @@
 
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.util.FtpClientUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemFactory;
 import org.jboss.soa.esb.util.Util;
 
-public class FtpGatewayListener extends AnOldFileGatewayListener
+public class FtpGatewayListener extends FileGatewayListener
 {
-	//protected FtpGatewayListener()
-	//{
-	//	super();
-	//}
+	// protected FtpGatewayListener()
+	// {
+	// super();
+	// }
 
 	public FtpGatewayListener(GatewayListenerController commandListener,
 			ConfigTree config) throws Exception
@@ -46,17 +48,19 @@
 	protected void checkMyParms() throws Exception
 	{
 		super.checkMyParms();
-
+		RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(_config, true);
+		rfs.quit();
 		FtpClientUtil ftpClient = new FtpClientUtil(_config, false);
 		ftpClient.quit();
 
 		// Copy FTP parameters to be passed to the action class (inside the
 		// WorkingFile class)
 		// This is a kludge - we have to get back to this (ES)
+		// Maybe we could get these out of the FTPEpr? (GEO)
 		String[] sa = new String[]
-		{ FtpClientUtil.PARMS_FTP_SERVER, FtpClientUtil.PARMS_USER,
-				FtpClientUtil.PARMS_PASSWD, FtpClientUtil.PARMS_PASSIVE,
-				FtpClientUtil.PARMS_PORT };
+		{ RemoteFileSystem.PARMS_FTP_SERVER, RemoteFileSystem.PARMS_USER,
+				RemoteFileSystem.PARMS_PASSWD, RemoteFileSystem.PARMS_PASSIVE,
+				RemoteFileSystem.PARMS_PORT };
 		for (String sProp : sa)
 		{
 			String sVal = _config.getAttribute(sProp);
@@ -70,7 +74,7 @@
 	{
 		// Bruno: is there any way that the remote directory exists, that we can
 		// read it, and that that we can write on it ?
-		// please see the AnewFileGatewayListener class to see what the method
+		// please see the FileGatewayListener class to see what the method
 		// does there
 	} // ________________________________
 
@@ -79,8 +83,7 @@
 	{
 		// Bruno: please check this and the rest of the methods.
 		// I just copied the RemoteDirectoryPoller, but I know you have been
-		// working on this
-		// so what I copied here could be stale
+		// working on this so what I copied here could be stale
 		FtpClientUtil ftpClient = null;
 		try
 		{

Modified: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2006-12-06 20:11:18 UTC (rev 8108)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2006-12-06 21:11:37 UTC (rev 8109)
@@ -19,6 +19,7 @@
  * 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.internal.soa.esb.util;
 
 import java.io.File;
@@ -45,10 +46,12 @@
  * </p>
  */
 
-public class EdtFtpImpl implements RemoteFileSystem {
+public class EdtFtpImpl implements RemoteFileSystem
+{
 	private static final String TMP_SUFFIX = ".rosettaPart";
 
-	public enum XFER_TYPE {
+	public enum XFER_TYPE
+	{
 		ascii, binary
 	};
 
@@ -67,7 +70,8 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
 	 */
-	public String getRemoteDir() {
+	public String getRemoteDir()
+	{
 		return m_sRemoteDir;
 	}
 
@@ -93,22 +97,26 @@
 	 *             in remote computer </li>
 	 */
 
-	public EdtFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws Exception {
+	public EdtFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws Exception
+	{
 		m_oParms = p_oP;
 		initialize(p_bConnect);
 	}
-	
+
 	public EdtFtpImpl(List<KeyValuePair> attribs, boolean connect)
-			throws Exception {
+			throws Exception
+	{
 		m_oParms = new ConfigTree("fromProps");
 		for (KeyValuePair oCurr : attribs)
 			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
 		initialize(connect);
 	}
-	
-	private void initialize(boolean bConnect) throws Exception {
+
+	private void initialize(boolean bConnect) throws Exception
+	{
 		checkParms();
-		if (bConnect) {
+		if (bConnect)
+		{
 			m_oConn.setRemoteHost(m_sFtpServer);
 			m_oConn.setRemotePort(m_iPort);
 			m_oConn.connect();
@@ -122,57 +130,64 @@
 					: FTPConnectMode.ACTIVE);
 		}
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
 	 */
-	public void quit() {
+	public void quit()
+	{
 		if (null != m_oConn)
-			try {
+			try
+			{
 				m_oConn.quit();
-			} catch (Exception e) {
+			} catch (Exception e)
+			{
 			}
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
 	 */
-	public void deleteRemoteFile(String p_sFile) throws Exception {
+	public void deleteRemoteFile(String p_sFile) throws Exception
+	{
 		m_oConn.delete(getRemoteDir() + "/" + new File(p_sFile).getName());
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
 	 */
-	public void remoteDelete(File p_oFile) throws Exception {
+	public void remoteDelete(File p_oFile) throws Exception
+	{
 		m_oConn.delete(fileToFtpString(p_oFile));
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
 	 */
-	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception {
+	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception
+	{
 		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
 		return m_oConn.dir(sSuffix);
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
 	 */
-	public void setRemoteDir(String p_sDir) throws Exception {
+	public void setRemoteDir(String p_sDir) throws Exception
+	{
 		m_oConn.chdir(p_sDir);
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -180,52 +195,59 @@
 	 *      java.lang.String)
 	 */
 	public void renameInRemoteDir(String p_sFrom, String p_sTo)
-			throws Exception {
+			throws Exception
+	{
 		String sRmtFrom = new File(p_sFrom).getName();
 		String sRmtTo = new File(p_sTo).getName();
 
-		try {
+		try
+		{
 			m_oConn.rename(getRemoteDir() + "/" + sRmtFrom, getRemoteDir()
 					+ "/" + sRmtTo);
-		} catch (Exception e) {
+		} catch (Exception e)
+		{
 			String sMess = this.getClass().getSimpleName()
 					+ " can't rename in remote directory <" + e.getMessage()
 					+ ">";
 			throw new Exception(sMess);
 		}
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
 	 *      java.io.File)
 	 */
-	public void remoteRename(File p_oFrom, File p_oTo) throws Exception {
-		try {
+	public void remoteRename(File p_oFrom, File p_oTo) throws Exception
+	{
+		try
+		{
 			m_oConn.rename(fileToFtpString(p_oFrom), fileToFtpString(p_oTo));
-		} catch (Exception e) {
+		} catch (Exception e)
+		{
 			String sMess = this.getClass().getSimpleName()
 					+ " can't rename in remote directory <" + e.getMessage()
 					+ ">";
 			throw new Exception(sMess);
 		}
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
 	 *      java.lang.String)
 	 */
-	public void uploadFile(File p_oFile, String p_sRemoteName) throws Exception {
+	public void uploadFile(File p_oFile, String p_sRemoteName) throws Exception
+	{
 		String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
 		String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
 		m_oConn.setType(m_oXferType);
 		m_oConn.put(fileToFtpString(p_oFile), sRemoteTmp);
 		m_oConn.rename(sRemoteTmp, sRemoteOK);
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -233,13 +255,17 @@
 	 *      java.lang.String)
 	 */
 	public void downloadFile(String p_sFile, String p_sFinalName)
-			throws Exception {
+			throws Exception
+	{
 		File oLocalDir = new File(m_sLocalDir);
 		File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
 
-		try {
+		try
+		{
 			oLclFile.delete();
-		} catch (Exception e) {
+		} catch (Exception e)
+		{
+			// TODO doseomthing about this
 		}
 		m_oConn.setType(m_oXferType);
 		m_oConn.get(fileToFtpString(oLclFile), p_sFile);
@@ -249,17 +275,19 @@
 			oNew.delete();
 		oLclFile.renameTo(oNew);
 	}
-	
+
 	// Beware !!! The logic here seems wrong, but it works
 	// It appears that there's some kind of bug in the edtftpj.jar library
 	// The !XFER_TYPE.ascii.equals(p_oMode) should NOT be negated
 	// But it works when negated (newlines from Unix to DOS)
-	private void setXferType(XFER_TYPE p_oMode) {
+	private void setXferType(XFER_TYPE p_oMode)
+	{
 		m_oXferType = !XFER_TYPE.ascii.equals(p_oMode) ? FTPTransferType.ASCII
 				: FTPTransferType.BINARY;
 	}
-	
-	private void checkParms() throws Exception {
+
+	private void checkParms() throws Exception
+	{
 		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
 		if (null == m_sFtpServer)
 			throw new Exception("No FTP server specified");
@@ -295,9 +323,10 @@
 
 		return;
 	}
-	
-	public static String fileToFtpString(File p_oF) {
+
+	public static String fileToFtpString(File p_oF)
+	{
 		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
 	}
-	
+
 }
\ No newline at end of file

Modified: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java	2006-12-06 20:11:18 UTC (rev 8108)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java	2006-12-06 21:11:37 UTC (rev 8109)
@@ -29,12 +29,13 @@
  * 
  */
 
-public class SecureFtpImpl implements RemoteFileSystem {
+public class SecureFtpImpl implements RemoteFileSystem
+{
 
 	private static final String TMP_SUFFIX = ".rosettaPart";
-        
-        private static final String SECURE_CHANNEL = "sftp";
 
+	private static final String SECURE_CHANNEL = "sftp";
+
 	private ConfigTree m_oParms;
 
 	private String m_sFtpServer, m_sUser, m_sPasswd;
@@ -63,22 +64,26 @@
 	@SuppressWarnings("unused")
 	private boolean m_bConnected;
 
-	public SecureFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws Exception {
+	public SecureFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws Exception
+	{
 		m_oParms = p_oP;
 		initialize(p_bConnect);
 	}
 
 	public SecureFtpImpl(List<KeyValuePair> attribs, boolean connect)
-			throws Exception {
+			throws Exception
+	{
 		m_oParms = new ConfigTree("fromProps");
 		for (KeyValuePair oCurr : attribs)
 			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
 		initialize(connect);
 	}
 
-	private void initialize(boolean bConnect) throws Exception {
+	private void initialize(boolean bConnect) throws Exception
+	{
 		checkParms();
-		if (bConnect) {
+		if (bConnect)
+		{
 			session = m_oJSch.getSession(m_sUser, m_sFtpServer, m_iPort);
 
 			// username and password will be given via UserInfo interface.
@@ -104,7 +109,8 @@
 
 	}
 
-	private void checkParms() throws Exception {
+	private void checkParms() throws Exception
+	{
 		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
 		if (null == m_sFtpServer)
 			throw new Exception("No FTP server specified");
@@ -128,10 +134,10 @@
 		String sAux = m_oParms.getAttribute(PARMS_PORT);
 		m_iPort = (null == sAux) ? 22 : Integer.parseInt(sAux);
 
-		//boolean bAscii = false;
+		// boolean bAscii = false;
 		sAux = m_oParms.getAttribute(PARMS_ASCII);
-		//if (null != sAux)
-		//	bAscii = Boolean.parseBoolean(sAux);
+		// if (null != sAux)
+		// bAscii = Boolean.parseBoolean(sAux);
 
 		m_bPassive = false;
 		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
@@ -147,7 +153,8 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
 	 */
-	public void deleteRemoteFile(String p_sFile) throws Exception {
+	public void deleteRemoteFile(String p_sFile) throws Exception
+	{
 		m_oSftpChannel.rm(getRemoteDir() + "/" + new File(p_sFile).getName());
 	}
 
@@ -158,7 +165,8 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
 	 */
-	public void remoteDelete(File p_oFile) throws Exception {
+	public void remoteDelete(File p_oFile) throws Exception
+	{
 		m_oSftpChannel.rm(fileToFtpString(p_oFile));
 	}
 
@@ -167,16 +175,21 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
 	 */
-	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception {
+	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception
+	{
 		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
 		List<String> lFileList = new ArrayList<String>();
 		Vector vFileList = m_oSftpChannel.ls(sSuffix);
-		if (vFileList != null) {
-			for (int i = 0; i < vFileList.size(); i++) {
+		if (vFileList != null)
+		{
+			for (int i = 0; i < vFileList.size(); i++)
+			{
 				Object obj = vFileList.elementAt(i);
-				if (obj instanceof LsEntry) {
+				if (obj instanceof LsEntry)
+				{
 					SftpATTRS oSftAttr = ((LsEntry) obj).getAttrs();
-					if (!oSftAttr.isDir()) {
+					if (!oSftAttr.isDir())
+					{
 						lFileList.add(((LsEntry) obj).getFilename());
 					}
 				}
@@ -190,7 +203,8 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
 	 */
-	public void setRemoteDir(String p_sDir) throws Exception {
+	public void setRemoteDir(String p_sDir) throws Exception
+	{
 		m_oSftpChannel.cd(p_sDir);
 	}
 
@@ -201,15 +215,18 @@
 	 *      java.lang.String)
 	 */
 	public void renameInRemoteDir(String p_sFrom, String p_sTo)
-			throws Exception {
+			throws Exception
+	{
 
 		String sRmtFrom = new File(p_sFrom).getName();
 		String sRmtTo = new File(p_sTo).getName();
 
-		try {
+		try
+		{
 			m_oSftpChannel.rename(getRemoteDir() + "/" + sRmtFrom,
 					getRemoteDir() + "/" + sRmtTo);
-		} catch (Exception e) {
+		} catch (Exception e)
+		{
 			String sMess = this.getClass().getSimpleName()
 					+ " can't rename in remote directory <" + e.getMessage()
 					+ ">";
@@ -223,11 +240,14 @@
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
 	 *      java.io.File)
 	 */
-	public void remoteRename(File p_oFrom, File p_oTo) throws Exception {
-		try {
+	public void remoteRename(File p_oFrom, File p_oTo) throws Exception
+	{
+		try
+		{
 			m_oSftpChannel.rename(fileToFtpString(p_oFrom),
 					fileToFtpString(p_oTo));
-		} catch (Exception e) {
+		} catch (Exception e)
+		{
 			String sMess = this.getClass().getSimpleName()
 					+ " can't rename in remote directory <" + e.getMessage()
 					+ ">";
@@ -241,7 +261,8 @@
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
 	 *      java.lang.String)
 	 */
-	public void uploadFile(File p_oFile, String p_sRemoteName) throws Exception {
+	public void uploadFile(File p_oFile, String p_sRemoteName) throws Exception
+	{
 		String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
 		String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
 		// m_oSftpChannel.setType(m_oXferType);
@@ -256,18 +277,25 @@
 	 *      java.lang.String)
 	 */
 	public void downloadFile(String p_sFile, String p_sFinalName)
-			throws Exception {
-		 File oLocalDir = new File(m_sLocalDir);
-	     File oLclFile= File.createTempFile("Rosetta_",TMP_SUFFIX,oLocalDir);
+			throws Exception
+	{
+		File oLocalDir = new File(m_sLocalDir);
+		File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
 
-	     try { oLclFile.delete(); }
-	     catch (Exception e) {}
-	     //TODO check if we have to set the Transfer Type with JSch impl => m_oXferType
-	     m_oSftpChannel.get(fileToFtpString(oLclFile),p_sFile);
+		try
+		{
+			oLclFile.delete();
+		} catch (Exception e)
+		{
+		}
+		// TODO check if we have to set the Transfer Type with JSch impl =>
+		// m_oXferType
+		m_oSftpChannel.get(fileToFtpString(oLclFile), p_sFile);
 
-	     File oNew = new File(oLocalDir,p_sFinalName);
-	     if (oNew.exists()) oNew.delete();
-	     oLclFile.renameTo(oNew);
+		File oNew = new File(oLocalDir, p_sFinalName);
+		if (oNew.exists())
+			oNew.delete();
+		oLclFile.renameTo(oNew);
 	}
 
 	/*
@@ -275,7 +303,8 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
 	 */
-	public String getRemoteDir() {
+	public String getRemoteDir()
+	{
 		return m_sRemoteDir;
 	}
 
@@ -284,11 +313,13 @@
 	 * 
 	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
 	 */
-	public void quit() {
+	public void quit()
+	{
 		m_oSftpChannel.quit();
 	}
 
-	public static String fileToFtpString(File p_oF) {
+	public static String fileToFtpString(File p_oF)
+	{
 		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
 	}
 

Modified: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java	2006-12-06 20:11:18 UTC (rev 8108)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java	2006-12-06 21:11:37 UTC (rev 8109)
@@ -1,15 +1,35 @@
-/**
- * 
+/*
+ * 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.internal.soa.esb.util;
 
 import com.jcraft.jsch.UserInfo;
 
 /**
- * @author geo
+ * @author b_georges
  * 
  */
-public class SecureFtpUserInfo implements UserInfo {
+public class SecureFtpUserInfo implements UserInfo
+{
 
 	/** The user-password */
 	String password = null;
@@ -20,7 +40,8 @@
 	 * @param password
 	 *            The users password.
 	 */
-	public SecureFtpUserInfo(String password) {
+	public SecureFtpUserInfo(String password)
+	{
 		this.password = password;
 	}
 
@@ -29,7 +50,8 @@
 	 * 
 	 * @see com.jcraft.jsch.UserInfo#getPassphrase()
 	 */
-	public String getPassphrase() {
+	public String getPassphrase()
+	{
 		return null;
 	}
 
@@ -38,7 +60,8 @@
 	 * 
 	 * @see com.jcraft.jsch.UserInfo#getPassword()
 	 */
-	public String getPassword() {
+	public String getPassword()
+	{
 		return password;
 	}
 
@@ -47,7 +70,8 @@
 	 * 
 	 * @see com.jcraft.jsch.UserInfo#promptPassphrase(java.lang.String)
 	 */
-	public boolean promptPassphrase(String arg0) {
+	public boolean promptPassphrase(String arg0)
+	{
 		return false;
 	}
 
@@ -56,7 +80,8 @@
 	 * 
 	 * @see com.jcraft.jsch.UserInfo#promptPassword(java.lang.String)
 	 */
-	public boolean promptPassword(String arg0) {
+	public boolean promptPassword(String arg0)
+	{
 		return true;
 	}
 
@@ -65,7 +90,8 @@
 	 * 
 	 * @see com.jcraft.jsch.UserInfo#promptYesNo(java.lang.String)
 	 */
-	public boolean promptYesNo(String arg0) {
+	public boolean promptYesNo(String arg0)
+	{
 		return true;
 	}
 
@@ -74,8 +100,9 @@
 	 * 
 	 * @see com.jcraft.jsch.UserInfo#showMessage(java.lang.String)
 	 */
-	public void showMessage(String arg0) {
-		
+	public void showMessage(String arg0)
+	{
+
 	}
 
 }

Modified: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java	2006-12-06 20:11:18 UTC (rev 8108)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java	2006-12-06 21:11:37 UTC (rev 8109)
@@ -44,6 +44,15 @@
  */
 public class FTPEpr extends FileEpr
 {
+	// TODO: Review the need for the User Information TAGs
+	// should the url be sufficient
+	// We could remove some of the TAGs below
+	// they will be accessible using java.net.URL
+	// rfc3986 for URI syntax 
+	//	protocol://username:password@hots:port
+	// example 
+	//  ftp://username:password@yourhost.com:21
+	
 	public static final String USERNAME_TAG = "username";
 	public static final String PASSWORD_TAG = "password";
 	public static final String PASSIVE_TAG = "passive";

Modified: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java	2006-12-06 20:11:18 UTC (rev 8108)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java	2006-12-06 21:11:37 UTC (rev 8109)
@@ -25,7 +25,9 @@
 import java.io.File;
 
 public interface RemoteFileSystem {
-
+	
+	public static final String PARMS_URL = "url";
+	
 	public static final String PARMS_FTP_SERVER = "ftpServer";
 
 	public static final String PARMS_USER = "ftpUser";
@@ -48,7 +50,7 @@
 	 * Terminates ftp session and frees resources
 	 * <li>Well behaved programs should make sure to call this method </li>
 	 */
-	public void quit(); //_________________________________
+	public void quit();
 
 	/**
 	 * Deletes specified file in remote directory
@@ -57,23 +59,23 @@
 	 * @throws Exception : if ftp connection cannot be established, or file
 	 * cannot be deleted in remote directory
 	 */
-	public void deleteRemoteFile(String p_sFile) throws Exception; //_________________________________
+	public void deleteRemoteFile(String p_sFile) throws Exception;
 
-	public void remoteDelete(File p_oFile) throws Exception; //_________________________________
+	public void remoteDelete(File p_oFile) throws Exception;
 
 	/**
 	 * 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 Exception : if ftp connection cannot be established, or problems encountered
 	 */
-	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception; //_________________________________
+	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception;
 
 	/**
 	 * Change remote directory
 	 * @param p_sDir String : directory to set
 	 * @throws Exception : if ftp connection cannot be established, or problems encountered
 	 */
-	public void setRemoteDir(String p_sDir) throws Exception; //_________________________________
+	public void setRemoteDir(String p_sDir) throws Exception;
 
 	/**
 	 * Renames specified file in remote directory to specified new name
@@ -85,10 +87,9 @@
 	 * within remote directory specified in 'remoteDirURI', to new name inside
 	 * the SAME remote directory
 	 */
-	public void renameInRemoteDir(String p_sFrom, String p_sTo)
-			throws Exception; //_________________________________
+	public void renameInRemoteDir(String p_sFrom, String p_sTo) throws Exception;
 
-	public void remoteRename(File p_oFrom, File p_oTo) throws Exception; //_________________________________
+	public void remoteRename(File p_oFrom, File p_oTo) throws Exception;
 
 	/**
 	 * Uploads specified file from local directory (localDirURI) to remote
@@ -101,7 +102,7 @@
 	 * <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 Exception; //_________________________________
+	public void uploadFile(File p_oFile, String p_sRemoteName) throws Exception;
 
 	/**
 	 * Downloads specified file from remote directory (remoteDirURI) to local
@@ -114,7 +115,6 @@
 	 * 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 Exception; //_________________________________
+	public void downloadFile(String p_sFile, String p_sFinalName) throws Exception;
 
 }
\ No newline at end of file

Added: labs/jbossesb/workspace/b_georges/product/docs/Thumbs.db
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/workspace/b_georges/product/docs/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-svn-commits mailing list