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 2019/02/14 15:14:08 UTC
[camel] branch master updated: CAMEL-13173 - Fixed CS
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 88bd145 CAMEL-13173 - Fixed CS
88bd145 is described below
commit 88bd145042f77743d0c32014b3ce66b2cde9fbd2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Feb 14 16:13:46 2019 +0100
CAMEL-13173 - Fixed CS
---
.../java/org/apache/camel/component/ipfs/IPFSComponent.java | 6 +++---
.../java/org/apache/camel/component/ipfs/IPFSEndpoint.java | 12 ++++++------
.../java/org/apache/camel/component/ipfs/SimpleIPFSTest.java | 11 ++++++-----
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSComponent.java b/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSComponent.java
index 982ee6c..a7260aa 100644
--- a/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSComponent.java
+++ b/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSComponent.java
@@ -19,13 +19,13 @@ package org.apache.camel.component.ipfs;
import java.net.URI;
import java.util.Map;
+import io.nessus.ipfs.client.DefaultIPFSClient;
+import io.nessus.ipfs.client.IPFSClient;
+
import org.apache.camel.Endpoint;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
-import io.nessus.ipfs.client.DefaultIPFSClient;
-import io.nessus.ipfs.client.IPFSClient;
-
@Component("ipfs")
public class IPFSComponent extends DefaultComponent {
diff --git a/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java b/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java
index 753c79b..0298143 100644
--- a/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java
+++ b/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java
@@ -26,6 +26,9 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
+import io.ipfs.multihash.Multihash;
+import io.nessus.ipfs.client.IPFSClient;
+
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
@@ -35,9 +38,6 @@ import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.support.DefaultEndpoint;
-import io.ipfs.multihash.Multihash;
-import io.nessus.ipfs.client.IPFSClient;
-
/**
* The camel-ipfs component provides access to the Interplanetary File System
* (IPFS).
@@ -45,7 +45,7 @@ import io.nessus.ipfs.client.IPFSClient;
@UriEndpoint(firstVersion = "2.23.0", scheme = "ipfs", title = "IPFS", syntax = "ipfs:host:port/cmd", producerOnly = true, label = "file,ipfs")
public class IPFSEndpoint extends DefaultEndpoint {
- static long DEFAULT_TIMEOUT = 10000L;
+ static long defaultTimeout = 10000L;
@UriParam
private final IPFSConfiguration configuration;
@@ -101,7 +101,7 @@ public class IPFSEndpoint extends DefaultEndpoint {
Multihash mhash = Multihash.fromBase58(cid);
Future<InputStream> future = ipfs().cat(mhash);
try {
- return future.get(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
+ return future.get(defaultTimeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException ex) {
throw new IOException("Cannot obtain: " + cid, ex);
}
@@ -111,7 +111,7 @@ public class IPFSEndpoint extends DefaultEndpoint {
Multihash mhash = Multihash.fromBase58(cid);
Future<Path> future = ipfs().get(mhash, outdir);
try {
- return future.get(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
+ return future.get(defaultTimeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException ex) {
throw new IOException("Cannot obtain: " + cid, ex);
}
diff --git a/components/camel-ipfs/src/test/java/org/apache/camel/component/ipfs/SimpleIPFSTest.java b/components/camel-ipfs/src/test/java/org/apache/camel/component/ipfs/SimpleIPFSTest.java
index 584d9f5..00bcf6a 100644
--- a/components/camel-ipfs/src/test/java/org/apache/camel/component/ipfs/SimpleIPFSTest.java
+++ b/components/camel-ipfs/src/test/java/org/apache/camel/component/ipfs/SimpleIPFSTest.java
@@ -25,6 +25,12 @@ import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
+
+import io.nessus.ipfs.client.DefaultIPFSClient;
+import io.nessus.ipfs.client.IPFSClient;
+import io.nessus.ipfs.client.IPFSException;
+import io.nessus.utils.StreamUtils;
+
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
@@ -34,11 +40,6 @@ import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
-import io.nessus.ipfs.client.DefaultIPFSClient;
-import io.nessus.ipfs.client.IPFSClient;
-import io.nessus.ipfs.client.IPFSException;
-import io.nessus.utils.StreamUtils;
-
public class SimpleIPFSTest {
IPFSClient ipfs;