fixed the issue #21267, moved to gcube-bom 2.0.1
This commit is contained in:
parent
03b78681e6
commit
6b528f8eef
|
@ -13,6 +13,7 @@
|
||||||
<attribute name="test" value="true"/>
|
<attribute name="test" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" path="src/test/resources"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.5.1-SNAPSHOT] - 2020-11-17
|
||||||
|
|
||||||
|
#### Fixes
|
||||||
|
|
||||||
|
[21267] Fixed the slf4j-log4j12 dependency
|
||||||
|
Moved to gcube-bom 2.0.1
|
||||||
|
|
||||||
|
## [v1.5.0] - 2019-11-26
|
||||||
|
|
||||||
|
[Task #16415] Migrate to Firebase Dynamic Links APIs
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.2.0] - 2017-06-14
|
||||||
|
|
||||||
|
[Support #8940] src/it/simple-it/pom.xm
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.1.1] - 2016-12-19
|
||||||
|
|
||||||
|
removed lo4j dependency from pom
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.1.0] - 2016-09-27
|
||||||
|
|
||||||
|
removed jump of scope during read of Runtime HTTP-URL-Shortener
|
||||||
|
|
||||||
|
removed constructor with the parameter scope
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.0.2] - 2016-06-30
|
||||||
|
|
||||||
|
removed maven portal bom dependency
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.0.1] - 2016-04-26
|
||||||
|
|
||||||
|
maven-bom replaced by portal-bom
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.0.0] - 2014-10-13
|
||||||
|
|
||||||
|
First Release
|
13
pom.xml
13
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>gcube-url-shortener</artifactId>
|
<artifactId>gcube-url-shortener</artifactId>
|
||||||
<version>1.5.0</version>
|
<version>1.5.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>gcube-url-shortener </name>
|
<name>gcube-url-shortener </name>
|
||||||
<description>The Gcube Url Shortener uses the Firebase Dynamic Links Short Links API provided by Google (at https://firebase.google.com/docs/reference/dynamic-links/link-shortener).
|
<description>The Gcube Url Shortener uses the Firebase Dynamic Links Short Links API provided by Google (at https://firebase.google.com/docs/reference/dynamic-links/link-shortener).
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>gcube-bom</artifactId>
|
||||||
<version>1.4.0</version>
|
<version>2.0.1</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -95,10 +95,17 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
<version>1.6.4</version>
|
<version>1.7.25</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON PARSER -->
|
<!-- JSON PARSER -->
|
||||||
|
|
|
@ -191,6 +191,15 @@ public final class UrlShortener {
|
||||||
JSONObject jsonObj = new JSONObject();
|
JSONObject jsonObj = new JSONObject();
|
||||||
//jsonObj.put(LONG_URL, longUrl);
|
//jsonObj.put(LONG_URL, longUrl);
|
||||||
String toLongURL = String.format("%s?link=%s",dynamicLink,longUrl);
|
String toLongURL = String.format("%s?link=%s",dynamicLink,longUrl);
|
||||||
|
|
||||||
|
/*String toRequestShortURL = longUrl;
|
||||||
|
if(toRequestShortURL.contains("?")) {
|
||||||
|
//I need to encode the URL before submit the request to Google DL
|
||||||
|
toRequestShortURL = URLEncoder.encode(longUrl, "UTF-8");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String toLongURL = String.format("%s?link=%s",dynamicLink,toRequestShortURL);*/
|
||||||
jsonObj.put(LONG_DYNAMIC_LINK, toLongURL);
|
jsonObj.put(LONG_DYNAMIC_LINK, toLongURL);
|
||||||
|
|
||||||
JSONObject jsonObjSuffix = null;
|
JSONObject jsonObjSuffix = null;
|
||||||
|
|
|
@ -2,12 +2,10 @@ package org.gcube.portlets.user.urlshortener;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class Encoder {
|
public class Encoder {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void encode() {
|
public void encode() {
|
||||||
|
|
||||||
// System.out.println(UrlEncoderUtil.encodeQuery("request=GetStyles", "layers=test Name", "service=WMS", "version=1.1.1"));
|
// System.out.println(UrlEncoderUtil.encodeQuery("request=GetStyles", "layers=test Name", "service=WMS", "version=1.1.1"));
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.gcube.portlets.user.urlshortener;
|
package org.gcube.portlets.user.urlshortener;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.junit.Test;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -18,7 +17,7 @@ public class Shortener {
|
||||||
protected static Logger logger = LoggerFactory.getLogger(Shortener.class);
|
protected static Logger logger = LoggerFactory.getLogger(Shortener.class);
|
||||||
protected static int tnt = 0;
|
protected static int tnt = 0;
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testShortener(){
|
public void testShortener(){
|
||||||
|
|
||||||
Thread th = new Thread(){
|
Thread th = new Thread(){
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.portlets.user.urlshortener;
|
package org.gcube.portlets.user.urlshortener;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ public class TestUrlShortener {
|
||||||
protected static Logger logger = LoggerFactory.getLogger(TestUrlShortener.class);
|
protected static Logger logger = LoggerFactory.getLogger(TestUrlShortener.class);
|
||||||
protected static int tnt = 0;
|
protected static int tnt = 0;
|
||||||
|
|
||||||
// @Test
|
@Test
|
||||||
public void testShortener(){
|
public void testShortener(){
|
||||||
|
|
||||||
Thread th = new Thread(){
|
Thread th = new Thread(){
|
||||||
|
@ -27,7 +28,7 @@ public class TestUrlShortener {
|
||||||
ScopeProvider.instance.set(scope);
|
ScopeProvider.instance.set(scope);
|
||||||
UrlShortener urlSh = new UrlShortener();
|
UrlShortener urlSh = new UrlShortener();
|
||||||
System.out.println("UrlShortener: "+urlSh);
|
System.out.println("UrlShortener: "+urlSh);
|
||||||
String shorten = urlSh.shorten("http://data.d4science.org/uri-resolver/UUFYTGtkaEtiK2s0TURzdTBQckpBSDJmbVkrOXAzazVHbWJQNStIS0N6Yz0");
|
String shorten = urlSh.shorten("https://data.dev.d4science.org/shub/E_YjVxTHljYUQ1WXdqeExVMUJBTG16cHhUTEF0OVBsdWZydzAvNHgwNG9pNkFUVEVNck1uOGd4YmVsUDJiei9DMw==");
|
||||||
//String shorten = urlSh.shorten("https://developers.google.com/url-shortener/v1/getting_started?hl=it "+new Random().nextDouble());
|
//String shorten = urlSh.shorten("https://developers.google.com/url-shortener/v1/getting_started?hl=it "+new Random().nextDouble());
|
||||||
System.out.println("Shorted: "+shorten);
|
System.out.println("Shorted: "+shorten);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
/devNext.gcubekey
|
||||||
|
/devsec.gcubekey
|
||||||
|
/gcube.gcubekey
|
||||||
|
/log4j.properties
|
||||||
|
/pred4s.gcubekey
|
||||||
|
/preprod.gcubekey
|
Loading…
Reference in New Issue