brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/9] git commit: Add license header to core/**/*.txt
Date Sat, 11 Oct 2014 13:04:34 GMT
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 <aled.sage@gmail.com>
Authored: Wed Oct 8 16:11:42 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
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 @@
         </dependency>
     </dependencies>
 
-  <!-- add maxmind geo-ip library; exact copy of source included as required by LGPL2
-->
-  <build>
-      <pluginManagement>
-          <plugins>
-              <plugin>
-                  <groupId>org.apache.rat</groupId>
-                  <artifactId>apache-rat-plugin</artifactId>
-                  <configuration>
-                      <excludes combine.children="append">
-                          <exclude>**/src/main/resources/**/*.txt</exclude>
-                          <exclude>**/src/test/resources/**/*.txt</exclude>
-                      </excludes>
-                  </configuration>
-              </plugin>
-          </plugins>
-      </pluginManagement>
-  </build>
-
 </project>

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<String> getIpAddressWebsites() {
         String file = new ResourceUtils(LocalhostExternalIpLoader.class)
                 .getResourceAsString("classpath://brooklyn/location/geo/external-ip-address-resolvers.txt");
-        List<String> urls = Lists.newArrayList(Splitter.on('\n')
+        Iterable<String> lines = Splitter.on('\n')
                 .omitEmptyStrings()
                 .trimResults()
-                .split(file));
+                .split(file);
+        List<String> 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.


Mime
View raw message