This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 25c479c034e Remove cruft not in use 25c479c034e is described below commit 25c479c034ef1be98256a9833e47b5c70ab476eb Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Aug 5 17:05:15 2022 +0200 Remove cruft not in use --- .../camel/component/stream/StreamConsumer.java | 2 +- .../camel/component/stream/mock/Handler.java | 33 ------------- .../component/stream/mock/MockURLConnection.java | 56 ---------------------- 3 files changed, 1 insertion(+), 90 deletions(-) diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java index 68e3c87a5bd..db40aed0402 100644 --- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java +++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java @@ -46,7 +46,7 @@ public class StreamConsumer extends DefaultConsumer implements Runnable { private static final Logger LOG = LoggerFactory.getLogger(StreamConsumer.class); - private static final String TYPES = "in,file,url"; + private static final String TYPES = "in,file"; private static final String INVALID_URI = "Invalid uri, valid form: 'stream:{" + TYPES + "}'"; private static final List<String> TYPES_LIST = Arrays.asList(TYPES.split(",")); private ExecutorService executor; diff --git a/components/camel-stream/src/test/java/org/apache/camel/component/stream/mock/Handler.java b/components/camel-stream/src/test/java/org/apache/camel/component/stream/mock/Handler.java deleted file mode 100644 index fe696763e05..00000000000 --- a/components/camel-stream/src/test/java/org/apache/camel/component/stream/mock/Handler.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.stream.mock; - -import java.net.URL; -import java.net.URLConnection; -import java.net.URLStreamHandler; - -/** - * Mock URL handler for testing URL connections. - */ -public class Handler extends URLStreamHandler { - - @Override - protected URLConnection openConnection(URL u) { - return new MockURLConnection(u); - } - -} diff --git a/components/camel-stream/src/test/java/org/apache/camel/component/stream/mock/MockURLConnection.java b/components/camel-stream/src/test/java/org/apache/camel/component/stream/mock/MockURLConnection.java deleted file mode 100644 index 5b00ac7b705..00000000000 --- a/components/camel-stream/src/test/java/org/apache/camel/component/stream/mock/MockURLConnection.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.stream.mock; - -import java.io.OutputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.LinkedHashMap; -import java.util.Map; - -public class MockURLConnection extends URLConnection { - - private static final ThreadLocal<OutputStream> THREAD_OUTPUT_STREAM = new ThreadLocal<>(); - - private static final Map<String, String> HEADERS = new LinkedHashMap<>(); - - public MockURLConnection(URL url) { - super(url); - } - - public static void setOutputStream(OutputStream outputStream) { - THREAD_OUTPUT_STREAM.set(outputStream); - } - - @Override - public void connect() { - } - - @Override - public OutputStream getOutputStream() { - return THREAD_OUTPUT_STREAM.get(); - } - - @Override - public void addRequestProperty(String key, String value) { - HEADERS.put(key, value); - } - - public static Map<String, String> getHeaders() { - return HEADERS; - } -}