Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F54F17888 for ; Sat, 11 Oct 2014 13:05:01 +0000 (UTC) Received: (qmail 4815 invoked by uid 500); 11 Oct 2014 13:05:01 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 4793 invoked by uid 500); 11 Oct 2014 13:05:01 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 4784 invoked by uid 99); 11 Oct 2014 13:05:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Oct 2014 13:05:01 +0000 X-ASF-Spam-Status: No, hits=-1995.9 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD,URIBL_BLACK,URI_TRY_3LD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 11 Oct 2014 13:04:37 +0000 Received: (qmail 4089 invoked by uid 99); 11 Oct 2014 13:04:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Oct 2014 13:04:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B8FE88931CB; Sat, 11 Oct 2014 13:04:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aledsage@apache.org To: commits@brooklyn.incubator.apache.org Date: Sat, 11 Oct 2014 13:04:34 -0000 Message-Id: <259450aa3bc14e2db8303685d7490a9d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/9] git commit: Add license header to core/**/*.txt X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-brooklyn Updated Branches: refs/heads/master 659db862b -> a81c53d45 Add license header to core/**/*.txt - to hello-world.txt - to external-ip-address-resolvers.txt (which also required code to treat # at the start of a line as a comment) Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c2d37781 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c2d37781 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c2d37781 Branch: refs/heads/master Commit: c2d377819756342b5a4c9a0c8e281cfdc7c00264 Parents: 0549c26 Author: Aled Sage Authored: Wed Oct 8 16:11:42 2014 +0100 Committer: Aled Sage Committed: Fri Oct 10 16:28:57 2014 +0100 ---------------------------------------------------------------------- core/pom.xml | 18 ------------------ .../location/geo/LocalhostExternalIpLoader.java | 9 +++++++-- .../geo/external-ip-address-resolvers.txt | 19 ++++++++++++++++++- core/src/test/resources/hello-world.txt | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2d37781/core/pom.xml ---------------------------------------------------------------------- diff --git a/core/pom.xml b/core/pom.xml index 9756910..ed57e2a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -221,22 +221,4 @@ - - - - - - org.apache.rat - apache-rat-plugin - - - **/src/main/resources/**/*.txt - **/src/test/resources/**/*.txt - - - - - - - http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2d37781/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java b/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java index aa9714e..74056bc 100644 --- a/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java +++ b/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java @@ -31,11 +31,15 @@ import org.slf4j.LoggerFactory; import brooklyn.util.ResourceUtils; import brooklyn.util.exceptions.Exceptions; +import brooklyn.util.text.StringPredicates; import brooklyn.util.time.Duration; import brooklyn.util.time.Durations; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Predicates; import com.google.common.base.Splitter; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.Iterables; import com.google.common.collect.Lists; public class LocalhostExternalIpLoader { @@ -78,10 +82,11 @@ public class LocalhostExternalIpLoader { static List getIpAddressWebsites() { String file = new ResourceUtils(LocalhostExternalIpLoader.class) .getResourceAsString("classpath://brooklyn/location/geo/external-ip-address-resolvers.txt"); - List urls = Lists.newArrayList(Splitter.on('\n') + Iterable lines = Splitter.on('\n') .omitEmptyStrings() .trimResults() - .split(file)); + .split(file); + List urls = Lists.newArrayList(Iterables.filter(lines, Predicates.not(StringPredicates.startsWith("#")))); Collections.shuffle(urls); return urls; } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2d37781/core/src/main/resources/brooklyn/location/geo/external-ip-address-resolvers.txt ---------------------------------------------------------------------- diff --git a/core/src/main/resources/brooklyn/location/geo/external-ip-address-resolvers.txt b/core/src/main/resources/brooklyn/location/geo/external-ip-address-resolvers.txt index 4a8cb6f..bc3c26e 100644 --- a/core/src/main/resources/brooklyn/location/geo/external-ip-address-resolvers.txt +++ b/core/src/main/resources/brooklyn/location/geo/external-ip-address-resolvers.txt @@ -1,3 +1,20 @@ +# 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. + http://jsonip.com/ http://myip.dnsomatic.com/ http://checkip.dyndns.org/ @@ -5,4 +22,4 @@ http://www.telize.com/ip http://wtfismyip.com/text http://whatismyip.akamai.com/ http://myip.wampdeveloper.com/ -http://icanhazip.com/ \ No newline at end of file +http://icanhazip.com/ http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2d37781/core/src/test/resources/hello-world.txt ---------------------------------------------------------------------- diff --git a/core/src/test/resources/hello-world.txt b/core/src/test/resources/hello-world.txt index fa2d6ce..35eee51 100644 --- a/core/src/test/resources/hello-world.txt +++ b/core/src/test/resources/hello-world.txt @@ -1 +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 +# +# 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. + The file hello-world.war contains its source code. It is included as a (small) binary to prevent build complication.