Skip to content
Snippets Groups Projects
Commit 0841dccb authored by Zachary Sabourin's avatar Zachary Sabourin
Browse files

feat: Update copyright headers on all Java files

Resolves #20
parent 549997cd
No related branches found
No related tags found
1 merge request!28feat: Update copyright headers on all Java files
Showing
with 204 additions and 107 deletions
/*********************************************************************
* Copyright (c) 2022 Eclipse Foundation.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.config; package org.eclipsefoundation.geoip.client.config;
import com.maxmind.db.MaxMindDbConstructor; import com.maxmind.db.MaxMindDbConstructor;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.helper; package org.eclipsefoundation.geoip.client.helper;
import java.util.Arrays; import java.util.Arrays;
...@@ -34,7 +39,7 @@ public class InetAddressHelper { ...@@ -34,7 +39,7 @@ public class InetAddressHelper {
if (address == null) { if (address == null) {
return false; return false;
} }
// check lightweight options first for invalid addresses // check lightweight options first for invalid addresses
if (INVALID_ADDRESSES_IPv4.contains(address) || INVALID_ADDRESSES_IPv6.contains(address)) { if (INVALID_ADDRESSES_IPv4.contains(address) || INVALID_ADDRESSES_IPv6.contains(address)) {
return false; return false;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.model; package org.eclipsefoundation.geoip.client.model;
import com.opencsv.bean.CsvBindByName; import com.opencsv.bean.CsvBindByName;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.model; package org.eclipsefoundation.geoip.client.model;
/** /**
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.model; package org.eclipsefoundation.geoip.client.model;
import com.opencsv.bean.CsvBindByName; import com.opencsv.bean.CsvBindByName;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources; package org.eclipsefoundation.geoip.client.resources;
import java.io.IOException; import java.io.IOException;
...@@ -24,7 +29,7 @@ import org.eclipsefoundation.geoip.client.helper.InetAddressHelper; ...@@ -24,7 +29,7 @@ import org.eclipsefoundation.geoip.client.helper.InetAddressHelper;
import org.eclipsefoundation.geoip.client.service.GeoIPService; import org.eclipsefoundation.geoip.client.service.GeoIPService;
/** /**
* @author martin * @author Martin Lowe
* *
*/ */
@Path("/cities") @Path("/cities")
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources; package org.eclipsefoundation.geoip.client.resources;
import java.io.IOException; import java.io.IOException;
...@@ -24,7 +29,7 @@ import org.eclipsefoundation.geoip.client.helper.InetAddressHelper; ...@@ -24,7 +29,7 @@ import org.eclipsefoundation.geoip.client.helper.InetAddressHelper;
import org.eclipsefoundation.geoip.client.service.GeoIPService; import org.eclipsefoundation.geoip.client.service.GeoIPService;
/** /**
* @author martin * @author Martin Lowe
* *
*/ */
@Path("/countries") @Path("/countries")
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources; package org.eclipsefoundation.geoip.client.resources;
import javax.inject.Inject; import javax.inject.Inject;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources.mapper; package org.eclipsefoundation.geoip.client.resources.mapper;
import java.net.UnknownHostException; import java.net.UnknownHostException;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.service; package org.eclipsefoundation.geoip.client.service;
import com.maxmind.geoip2.record.City; import com.maxmind.geoip2.record.City;
import com.maxmind.geoip2.record.Country; import com.maxmind.geoip2.record.Country;
/** /**
* @author martin * @author Martin Lowe
* *
*/ */
public interface GeoIPService { public interface GeoIPService {
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.service; package org.eclipsefoundation.geoip.client.service;
import java.util.List; import java.util.List;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.service.impl; package org.eclipsefoundation.geoip.client.service.impl;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
...@@ -58,7 +63,7 @@ public class CSVNetworkService implements NetworkService { ...@@ -58,7 +63,7 @@ public class CSVNetworkService implements NetworkService {
loadCountries(countriesFilePath, countryIdToIso); loadCountries(countriesFilePath, countryIdToIso);
loadMap(ipv4FilePath, ipv4Subnets); loadMap(ipv4FilePath, ipv4Subnets);
// Disabled as it is a 2million item list and crashes the app // Disabled as it is a 2million item list and crashes the app
//loadMap(ipv6FilePath, ipv6Subnets); // loadMap(ipv6FilePath, ipv6Subnets);
} }
@Override @Override
...@@ -110,5 +115,5 @@ public class CSVNetworkService implements NetworkService { ...@@ -110,5 +115,5 @@ public class CSVNetworkService implements NetworkService {
throw new RuntimeException("Error while reading in CSV file at path " + filePath, e); throw new RuntimeException("Error while reading in CSV file at path " + filePath, e);
} }
} }
} }
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.service.impl; package org.eclipsefoundation.geoip.client.service.impl;
import java.io.File; import java.io.File;
...@@ -66,17 +71,17 @@ public class MaxMindGeoIPService implements GeoIPService { ...@@ -66,17 +71,17 @@ public class MaxMindGeoIPService implements GeoIPService {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
@PreDestroy @PreDestroy
public void destroy() { public void destroy() {
try { try {
this.countryReader.close(); this.countryReader.close();
this.cityReader.close(); this.cityReader.close();
} catch (IOException e) { } catch (IOException e) {
LOGGER.error("Error while closing Geo IP databases, potential memory leak",e); LOGGER.error("Error while closing Geo IP databases, potential memory leak", e);
} }
} }
@Override @Override
public City getCity(String ipAddr) { public City getCity(String ipAddr) {
try { try {
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources; package org.eclipsefoundation.geoip.client.resources;
import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.given;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources; package org.eclipsefoundation.geoip.client.resources;
import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.given;
......
/* Copyright (c) 2019 Eclipse Foundation and others. /*********************************************************************
* This program and the accompanying materials are made available * Copyright (c) 2019 Eclipse Foundation.
* under the terms of the Eclipse Public License 2.0 *
* which is available at http://www.eclipse.org/legal/epl-v20.html, * This program and the accompanying materials are made
* SPDX-License-Identifier: EPL-2.0 * available under the terms of the Eclipse Public License 2.0
*/ * which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.resources; package org.eclipsefoundation.geoip.client.resources;
import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.given;
......
/*********************************************************************
* Copyright (c) 2022 Eclipse Foundation.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.geoip.client.test.namespaces; package org.eclipsefoundation.geoip.client.test.namespaces;
public class SchemaNamespaceHelper { public class SchemaNamespaceHelper {
public static final String BASE_SCHEMAS_PATH = "schemas/"; public static final String BASE_SCHEMAS_PATH = "schemas/";
public static final String BASE_SCHEMAS_PATH_SUFFIX = "-schema.json"; public static final String BASE_SCHEMAS_PATH_SUFFIX = "-schema.json";
public static final String CITY_SCHEMA_PATH = BASE_SCHEMAS_PATH + "city" public static final String CITY_SCHEMA_PATH = BASE_SCHEMAS_PATH + "city"
+ BASE_SCHEMAS_PATH_SUFFIX; + BASE_SCHEMAS_PATH_SUFFIX;
public static final String COUNTRY_SCHEMA_PATH = BASE_SCHEMAS_PATH + "country" public static final String COUNTRY_SCHEMA_PATH = BASE_SCHEMAS_PATH + "country"
+ BASE_SCHEMAS_PATH_SUFFIX; + BASE_SCHEMAS_PATH_SUFFIX;
public static final String IP_ADDRESSES_SCHEMA_PATH = BASE_SCHEMAS_PATH + "ip-addresses" public static final String IP_ADDRESSES_SCHEMA_PATH = BASE_SCHEMAS_PATH + "ip-addresses"
+ BASE_SCHEMAS_PATH_SUFFIX; + BASE_SCHEMAS_PATH_SUFFIX;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment