Exemplo n.º 1
0
 @Override
 public String toString() {
   if (ftpConsumerToString == null) {
     ftpConsumerToString =
         "FtpConsumer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
   }
   return ftpConsumerToString;
 }
Exemplo n.º 2
0
 @Override
 public String toString() {
   String value = null;
   try {
     value = getEndpointUri();
   } catch (RuntimeException e) {
     // ignore any exception and use null for building the string value
   }
   return String.format("Endpoint[%s]", URISupport.sanitizeUri(value));
 }
Exemplo n.º 3
0
 public void testSanitizeUri() {
   assertNull(URISupport.sanitizeUri(null));
   assertEquals("", URISupport.sanitizeUri(""));
   assertSanitizedUriUnchanged("http://camel.apache.org");
   assertSanitizedUriUnchanged("irc://irc.codehaus.org/camel");
   assertSanitizedUriUnchanged("direct:foo?bar=123&cheese=yes");
   assertSanitizedUriUnchanged(
       "https://issues.apache.org/activemq/secure/AddComment!default.jspa?id=33239");
   assertEquals(
       "ftp://host.mysite.com/records?passiveMode=true&user=someuser&password=xxxxxx",
       URISupport.sanitizeUri(
           "ftp://host.mysite.com/records?passiveMode=true&user=someuser&password=superSecret"));
   assertEquals(
       "sftp://host.mysite.com/records?user=someuser&privateKeyFile=key.file&privateKeyFilePassphrase=xxxxxx&knownHostsFile=hosts.list",
       URISupport.sanitizeUri(
           "sftp://host.mysite.com/records?user=someuser&privateKeyFile=key.file&privateKeyFilePassphrase=superSecret&knownHostsFile=hosts.list"));
   assertEquals(
       "aws-sqs://MyQueue?accessKey=1672t4rflhnhli3&secretKey=xxxxxx",
       URISupport.sanitizeUri(
           "aws-sqs://MyQueue?accessKey=1672t4rflhnhli3&secretKey=qi472qfberu33dqjncq"));
 }
Exemplo n.º 4
0
 @Override
 public String toString() {
   return "Consumer[" + URISupport.sanitizeUri(endpoint.getEndpointUri()) + "]";
 }
Exemplo n.º 5
0
 @Override
 public String toString() {
   return "PublishEventNotifier["
       + (endpoint != null ? endpoint : URISupport.sanitizeUri(endpointUri))
       + "]";
 }
Exemplo n.º 6
0
 @Override
 public String toString() {
   return "SWFWorkflowConsumer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
 }
Exemplo n.º 7
0
 /**
  * Ensures that the Uri was not changed because no password was found.
  *
  * @param uri The uri to test.
  */
 private void assertSanitizedUriUnchanged(String uri) {
   assertEquals(uri, URISupport.sanitizeUri(uri));
 }