You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/02/13 12:04:55 UTC

camel git commit: Optimize toString on camel-ftp consumer/producer

Repository: camel
Updated Branches:
  refs/heads/master 9123caf36 -> b2b02f035


Optimize toString on camel-ftp consumer/producer


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b2b02f03
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b2b02f03
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b2b02f03

Branch: refs/heads/master
Commit: b2b02f0352b12906d01f32a47d34c70949a670f4
Parents: 9123caf
Author: Andrea Cosentino <an...@gmail.com>
Authored: Sat Feb 13 12:04:09 2016 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Sat Feb 13 12:04:09 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/file/remote/FtpConsumer.java   | 7 ++++++-
 .../camel/component/file/remote/RemoteFileProducer.java       | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b2b02f03/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
index 820fc28..c0a37fe 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
@@ -34,6 +34,8 @@ import org.apache.commons.net.ftp.FTPFile;
 public class FtpConsumer extends RemoteFileConsumer<FTPFile> {
 
     protected String endpointPath;
+   
+    private transient String ftpConsumerToString;
 
     public FtpConsumer(RemoteFileEndpoint<FTPFile> endpoint, Processor processor, RemoteFileOperations<FTPFile> fileOperations) {
         super(endpoint, processor, fileOperations);
@@ -263,6 +265,9 @@ public class FtpConsumer extends RemoteFileConsumer<FTPFile> {
 
     @Override
     public String toString() {
-        return "FtpConsumer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+        if (ftpConsumerToString == null) {
+            ftpConsumerToString = "FtpConsumer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+        }
+        return ftpConsumerToString;
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/b2b02f03/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
index 7ad27fa..32a8a62 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
@@ -30,6 +30,8 @@ public class RemoteFileProducer<T> extends GenericFileProducer<T> implements Ser
 
     private boolean loggedIn;
     
+    private transient String remoteFileProducerToString;
+    
     protected RemoteFileProducer(RemoteFileEndpoint<T> endpoint, RemoteFileOperations<T> operations) {
         super(endpoint, operations);
     }
@@ -219,6 +221,9 @@ public class RemoteFileProducer<T> extends GenericFileProducer<T> implements Ser
 
     @Override
     public String toString() {
-        return "RemoteFileProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+        if (remoteFileProducerToString == null) {
+            remoteFileProducerToString = "RemoteFileProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+        }
+        return remoteFileProducerToString;
     }
 }