From 98bbfa11070a62956d7e2663a82f19fd048d1d5e Mon Sep 17 00:00:00 2001 From: rudolf Date: Thu, 18 Dec 2003 19:19:09 +0000 Subject: MOAIdentities wird von XMLLoginParameterResolver verwendet git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@77 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../src/at/gv/egovernment/moa/util/FileUtils.java | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'common/src/at') diff --git a/common/src/at/gv/egovernment/moa/util/FileUtils.java b/common/src/at/gv/egovernment/moa/util/FileUtils.java index bb21f4ca0..ae8d83834 100644 --- a/common/src/at/gv/egovernment/moa/util/FileUtils.java +++ b/common/src/at/gv/egovernment/moa/util/FileUtils.java @@ -1,11 +1,10 @@ package at.gv.egovernment.moa.util; import java.io.BufferedInputStream; +import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; /** @@ -95,17 +94,19 @@ public class FileUtils { */ public static String makeAbsoluteURL(String url, String root) { //if url is relative to rootConfigFileDirName make it absolute - try { - if(null == url) return null; - URI uri = new URI(url); - if (!uri.isAbsolute()) { // make it absolute to the config file - uri = new URI(root + url); - } - return uri.toString(); - } catch (URISyntaxException e) { - //if url string could not be converted to absolute URL return source url - return url; - } + + File keyFile; + String newURL = url; + + if(null == url) return null; + + // check if absolute - if not make it absolute + keyFile = new File(url); + if (!keyFile.isAbsolute()) { + keyFile = new File(root, url); + newURL = keyFile.getPath(); + } + return newURL; } } -- cgit v1.2.3