minor fix

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/catalogue-sharing-widget@146761 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-04-11 13:59:40 +00:00
parent 76fe044e4a
commit 8af0ce8f17
1 changed files with 4 additions and 3 deletions

View File

@ -44,11 +44,12 @@ public class ShareServicesImpl extends RemoteServiceServlet implements ShareServ
String shortUrl = null;
UrlShortener shortener = new UrlShortener();
if(shortener!=null && shortener.isAvailable())
try{
UrlShortener shortener = new UrlShortener();
shortUrl = shortener.shorten(longUrl);
else
}catch(Exception e){
logger.warn("Short url not available");
}
return new ItemUrls(shortUrl, longUrl, uuid, dataset.getName(), dataset.getTitle());
}