- Previous thread: CONF - Apache Camel > JPA
- Next thread: jira - Created: (CAMEL-2988) Add removeEndpoints to CamelContext
- Threads sorted by date: apachecamel 201007
Author: davsclaus
Date: Fri Jul 23 12:38:01 2010
New Revision: 967074
URL: http://svn.apache.org/viewvc?rev–7074&view=rev
Log:
CAMEL-2952: camel-ftp now works with MVS file systems.
Modified:
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java?rev–7074&r1–7073&r2–7074&view=dff
==============================================================================
@SuppressWarnings("unchecked")
@@ -317,9 +336,24 @@ public class FtpOperations implements Re
try {
GenericFile target = (GenericFile) exchange.getProperty(FileComponent.FILE-EXCHANGE-FILE);
// store the java.io.File handle as the body
- target.setBody(local);
- result = client.retrieveFile(name, os);
+ target.setBody(local);
+
+ // remember current directory
+ String currentDir = getCurrentDirectory();
+
+ // change directory to path where the file is to be retrieved
+ // (must do this as some FTP servers cannot retrieve using absolute path)
+ String path = FileUtil.onlyPath(name);
+ if (path != null) {
+ changeCurrentDirectory(path);
+ }
+ String onlyName = FileUtil.stripPath(name);
+
+ result = client.retrieveFile(onlyName, os);
+ // change back to current directory
+ changeCurrentDirectory(currentDir);
+
} catch (IOException e) {
throw new GenericFileOperationFailedException(client.getReplyCode(), client.getReplyString(), e.getMessage(), e);
} finally {
Date: Fri Jul 23 12:38:01 2010
New Revision: 967074
URL: http://svn.apache.org/viewvc?rev–7074&view=rev
Log:
CAMEL-2952: camel-ftp now works with MVS file systems.
Modified:
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java?rev–7074&r1–7073&r2–7074&view=dff
==============================================================================
@SuppressWarnings("unchecked")
@@ -317,9 +336,24 @@ public class FtpOperations implements Re
try {
GenericFile target = (GenericFile) exchange.getProperty(FileComponent.FILE-EXCHANGE-FILE);
// store the java.io.File handle as the body
- target.setBody(local);
- result = client.retrieveFile(name, os);
+ target.setBody(local);
+
+ // remember current directory
+ String currentDir = getCurrentDirectory();
+
+ // change directory to path where the file is to be retrieved
+ // (must do this as some FTP servers cannot retrieve using absolute path)
+ String path = FileUtil.onlyPath(name);
+ if (path != null) {
+ changeCurrentDirectory(path);
+ }
+ String onlyName = FileUtil.stripPath(name);
+
+ result = client.retrieveFile(onlyName, os);
+ // change back to current directory
+ changeCurrentDirectory(currentDir);
+
} catch (IOException e) {
throw new GenericFileOperationFailedException(client.getReplyCode(), client.getReplyString(), e.getMessage(), e);
} finally {
Related Threads
- Need help in Python regular expression - python
- Getting ubuntu on arm Board - ubuntu
- [Samba] failed tcon_X with NT_STATUS_IO_TIMEOUT - samba
- cpusets: document adding/removing cpus to cpuset elaborately - kernel
- [PATCH] m68k: merge the non-mmu and mmu versions of hardirq.h - kernel
- Abstract models and 'blank' (etc.) constraints - django
- Url encoding for get parameters - ofbiz
- Re: sqlplus connect string issue - oracle
- Finding who truncated the table - oracle