jfreereport_librepository: [deprecation] toURL() in File has been deprecated

http://docs.oracle.com/javase/6/docs/api/java/io/File.html#toURL()

Change-Id: I27d67f930ab15b69319a733b4bdedde834aba48d
Reviewed-on: https://gerrit.libreoffice.org/10530
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
This commit is contained in:
rbuj 2014-07-25 11:34:36 +02:00 committed by David Tardon
parent 66f4347aff
commit 02085703db

View file

@ -9,3 +9,29 @@
}
/**
--- misc/librepository-1.1.6/source/org/pentaho/reporting/libraries/repository/file/FileRepository.java 2010-04-27 16:04:50.000000000 +0200
+++ misc/build/librepository-1.1.6/source/org/pentaho/reporting/libraries/repository/file/FileRepository.java 2014-07-25 11:21:51.000000000 +0200
@@ -19,7 +19,9 @@
import java.io.File;
import java.io.Serializable;
+import java.lang.SecurityException;
import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URL;
import org.pentaho.reporting.libraries.repository.ContentIOException;
@@ -104,6 +106,11 @@
*/
public URL getURL() throws MalformedURLException
{
- return root.getBackend().toURL();
+ try {
+ URI uri = root.getBackend().toURI();
+ return uri.toURL();
+ } catch (SecurityException e) {
+ throw new MalformedURLException("impossible" + e);
+ }
}
}