Revision 12756 branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/schemas/records/Record.java
Record.java | ||
---|---|---|
238 | 238 |
*/ |
239 | 239 |
public void setURI(URI uri) { |
240 | 240 |
this.uri = uri; |
241 |
}
|
|
241 |
} |
|
242 | 242 |
|
243 |
/** |
|
244 |
* Only Used for Geonetwork |
|
245 |
* @return |
|
246 |
* @param imageUrl Server URL |
|
247 |
* @param port Port to connect |
|
248 |
*/ |
|
249 |
private String getGeonetworkImageUrl(String imageUrl, String port) { |
|
250 |
if (getURI() == null) |
|
251 |
return ""; |
|
252 |
return "http://" + getURI().getHost() + ":" + port + "/geonetwork/srv/es/resources.getgraphover?" + |
|
253 |
"id=" + getFileID() + "&" + |
|
254 |
"fname=" + imageUrl; |
|
243 |
public String getImageURL() { |
|
244 |
return imageURL; |
|
255 | 245 |
} |
256 |
|
|
257 |
/** |
|
258 |
* It gets an image from a URL |
|
259 |
* @return |
|
260 |
* @param sUrl String with the image URL |
|
261 |
*/ |
|
262 |
protected BufferedImage getImage(String sUrl) { |
|
263 |
try { |
|
264 |
URL Url = new URL(sUrl); |
|
265 |
|
|
266 |
return ImageIO.read(Url); |
|
267 |
} catch (MalformedURLException e) { |
|
268 |
// TODO Auto-generated catch block |
|
269 |
System.out.println("La URL de la imagen no es correcta: " + sUrl); |
|
270 |
} catch (IOException e1) { |
|
271 |
// TODO Auto-generated catch block |
|
272 |
System.out.println("No he podido leer la imagen desde la URL: " + sUrl); |
|
273 |
} |
|
274 |
return null; |
|
275 |
} |
|
246 |
|
|
276 | 247 |
} |
Also available in: Unified diff