XbmcUtils.java
Go to the documentation of this file.
00001 
00009 package org.rosmultimedia.player.xbmc.internal;
00010 
00011 import java.io.UnsupportedEncodingException;
00012 import java.net.URLDecoder;
00013 
00014 import com.google.common.base.Strings;
00015 
00021 public class XbmcUtils {
00025     public static String getImageUrl(String url) {
00026         String imageurl = url;
00027 
00028         if (!Strings.isNullOrEmpty(imageurl)) {
00029             if (imageurl.contains("http")) {
00030                 try {
00031                     imageurl = URLDecoder.decode(
00032                             imageurl.replace("image://", ""), "utf-8");
00033                 } catch (UnsupportedEncodingException e) {
00034                     e.printStackTrace();
00035                 }
00036             }
00037 
00038             /*String credentials = "";
00039 
00040             if (!Strings.isNullOrEmpty(this.node.getUser())) {
00041                 credentials += this.node.getUser();
00042             }
00043 
00044             if (!Strings.isNullOrEmpty(this.node.getPassword())) {
00045                 credentials += ":" + this.node.getPassword();
00046             }
00047 
00048             if (!Strings.isNullOrEmpty(credentials)) {
00049                 credentials += "@";
00050             }
00051 
00052             imageurl = String.format("http://%s%s:%s/", credentials,
00053                     this.node.getHost(), this.node.getPort())
00054                     + imageurl;
00055 
00056             imageurl = imageurl.replace("image://", "image/");*/
00057 
00058             if (imageurl.endsWith("/")) {
00059                 imageurl = imageurl.substring(0, imageurl.length() - 1);
00060             }
00061         }
00062 
00063         return imageurl;
00064     }
00065 }


smarthome_media_kodi_driver
Author(s): Mickael Gaillard , Erwan Le Huitouze
autogenerated on Thu Jun 6 2019 21:03:49