scripting: decode(String) in URLDecoder has been deprecated

http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLDecoder.html#decode(java.lang.String)

Change-Id: I71ecb498c93d5e8d6959bdc3ab263a5ff48c1c21
Reviewed-on: https://gerrit.libreoffice.org/11453
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
rbuj
2014-09-15 12:05:02 +02:00
committed by Noel Grandin
parent 0b3b907e96
commit f93ce4f7eb

View File

@@ -174,12 +174,21 @@ public class ParcelContainer implements XNameAccess
// TODO handler package ParcelContainer?
if ( !containerUrl.startsWith( "vnd.sun.star.tdoc:" ) )
{
// return name
String decodedUrl = java.net.URLDecoder.decode( containerUrl );
int indexOfSlash = decodedUrl.lastIndexOf('/');
if ( indexOfSlash != -1 )
try
{
name = decodedUrl.substring( indexOfSlash + 1 );
// return name
String decodedUrl = java.net.URLDecoder.decode( containerUrl, "UTF-8" );
int indexOfSlash = decodedUrl.lastIndexOf('/');
if ( indexOfSlash != -1 )
{
name = decodedUrl.substring( indexOfSlash + 1 );
}
}
catch (UnsupportedEncodingException e)
{
com.sun.star.uno.RuntimeException e2 = new com.sun.star.uno.RuntimeException();
e2.initCause(e);
throw e2;
}
}
else