Repository: camel Updated Branches: refs/heads/master 17f31529b -> b2862c147
CAMEL-8055 Fixed some CS errors and Unit test error Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fbfa333d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fbfa333d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fbfa333d Branch: refs/heads/master Commit: fbfa333d41718adbb53d44875e0b43ee6137b5cc Parents: b7db5c8 Author: Willem Jiang <[email protected]> Authored: Wed Nov 19 16:11:20 2014 +0800 Committer: Willem Jiang <[email protected]> Committed: Fri Jan 30 13:02:29 2015 +0800 ---------------------------------------------------------------------- .../camel/component/atmos/AtmosComponent.java | 20 ++++++------ .../component/atmos/AtmosConfiguration.java | 33 +++++++++----------- .../camel/component/atmos/AtmosEndpoint.java | 20 ++++++------ .../component/atmos/core/AtmosAPIFacade.java | 20 ++++++------ .../atmos/util/AtmosPropertyManager.java | 2 -- .../validator/AtmosConfigurationValidator.java | 20 ++++++------ .../src/main/resources/atmos.properties | 21 ------------- .../src/test/resources/atmos.properties | 22 +++++++++++++ .../src/test/resources/test-options.properties | 21 ------------- 9 files changed, 77 insertions(+), 102 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosComponent.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosComponent.java index 576c955..0008ce6 100644 --- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosComponent.java +++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosComponent.java @@ -1,18 +1,18 @@ /** * 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 + * 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 + * 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. + * 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.atmos; http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosConfiguration.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosConfiguration.java index 43a7386..71b41ac 100644 --- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosConfiguration.java +++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosConfiguration.java @@ -1,26 +1,27 @@ /** * 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 + * 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 + * 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. + * 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.atmos; +import java.net.URI; +import java.net.URISyntaxException; + import com.emc.atmos.api.AtmosApi; import com.emc.atmos.api.AtmosConfig; import com.emc.atmos.api.jersey.AtmosApiClient; -import java.net.URI; -import java.net.URISyntaxException; import org.apache.camel.component.atmos.util.AtmosException; import org.apache.camel.component.atmos.util.AtmosOperation; @@ -72,16 +73,12 @@ public class AtmosConfiguration { } catch (URISyntaxException use) { throw new AtmosException("wrong syntax for Atmos URI!", use); } - if (config == null) { - throw new AtmosException("can't configure the Atmos client!"); - } + if (!enableSslValidation) { config.setDisableSslValidation(true); } AtmosApi atmosclient = new AtmosApiClient(config); - if (atmosclient == null) { - throw new AtmosException("can't establish an Atmos connection!"); - } + this.client = atmosclient; } http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java index f272ab4..29841db 100644 --- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java +++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java @@ -1,18 +1,18 @@ /** * 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 + * 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 + * 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. + * 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.atmos; http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/core/AtmosAPIFacade.java ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/core/AtmosAPIFacade.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/core/AtmosAPIFacade.java index 852193e..2fe0234 100644 --- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/core/AtmosAPIFacade.java +++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/core/AtmosAPIFacade.java @@ -1,18 +1,18 @@ /** * 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 + * 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 + * 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. + * 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.atmos.core; http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/util/AtmosPropertyManager.java ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/util/AtmosPropertyManager.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/util/AtmosPropertyManager.java index cc8ceec..0b76edb 100644 --- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/util/AtmosPropertyManager.java +++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/util/AtmosPropertyManager.java @@ -47,14 +47,12 @@ public final class AtmosPropertyManager { try { inStream = url.openStream(); } catch (IOException e) { - e.printStackTrace(); throw new AtmosException("atmos.properties could not be found"); } properties = new Properties(); try { properties.load(inStream); } catch (IOException e) { - e.printStackTrace(); throw new AtmosException("atmos.properties can't be read"); } return properties; http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/validator/AtmosConfigurationValidator.java ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/validator/AtmosConfigurationValidator.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/validator/AtmosConfigurationValidator.java index ccb2fcf..ec16fad 100644 --- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/validator/AtmosConfigurationValidator.java +++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/validator/AtmosConfigurationValidator.java @@ -1,18 +1,18 @@ /** * 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 + * 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 + * 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. + * 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.atmos.validator; http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/main/resources/atmos.properties ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/main/resources/atmos.properties b/components/camel-atmos/src/main/resources/atmos.properties deleted file mode 100644 index c51ff51..0000000 --- a/components/camel-atmos/src/main/resources/atmos.properties +++ /dev/null @@ -1,21 +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. -## --------------------------------------------------------------------------- - -fullTokenId=<Subtentant_ID/UID> -secretKey=<UID_shared_secret> -uri=<http(s)://atmos_host> -sslValidation=<true|false> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/test/resources/atmos.properties ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/test/resources/atmos.properties b/components/camel-atmos/src/test/resources/atmos.properties new file mode 100644 index 0000000..4932d00 --- /dev/null +++ b/components/camel-atmos/src/test/resources/atmos.properties @@ -0,0 +1,22 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +fullTokenId=<Subtentant_ID/UID> +secretKey=<UID_shared_secret> +# The uri need to valide value +uri=http://atmos_host +sslValidation=<true|false> http://git-wip-us.apache.org/repos/asf/camel/blob/fbfa333d/components/camel-atmos/src/test/resources/test-options.properties ---------------------------------------------------------------------- diff --git a/components/camel-atmos/src/test/resources/test-options.properties b/components/camel-atmos/src/test/resources/test-options.properties deleted file mode 100644 index 52e50d9..0000000 --- a/components/camel-atmos/src/test/resources/test-options.properties +++ /dev/null @@ -1,21 +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. -## --------------------------------------------------------------------------- - -fullTokenId=<Subtentant_ID/UID> -secretKey=<UID_shared_secret> -uri=<http(s)://atmos_host> -sslValidation=<true|false>
