aboutsummaryrefslogtreecommitdiff
path: root/common/src/at/gv/egovernment
diff options
context:
space:
mode:
authorharald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d>2006-02-28 14:03:21 +0000
committerharald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d>2006-02-28 14:03:21 +0000
commit0eb787866e2818c65eca76dd070771e809f9bdd2 (patch)
treee82d4f958246623ad8d5e701ca98daac2fae0761 /common/src/at/gv/egovernment
parent3d5a8a5cbe16c04ad7c6391fc26505af67b55ab4 (diff)
downloadmoa-id-spss-0eb787866e2818c65eca76dd070771e809f9bdd2.tar.gz
moa-id-spss-0eb787866e2818c65eca76dd070771e809f9bdd2.tar.bz2
moa-id-spss-0eb787866e2818c65eca76dd070771e809f9bdd2.zip
method makeAbsoluteURL does not work if URL starts with
a protocol like "http://" or "file://". Fixed this. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@632 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'common/src/at/gv/egovernment')
-rw-r--r--common/src/at/gv/egovernment/moa/util/FileUtils.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/common/src/at/gv/egovernment/moa/util/FileUtils.java b/common/src/at/gv/egovernment/moa/util/FileUtils.java
index ae8d83834..a5e777c2d 100644
--- a/common/src/at/gv/egovernment/moa/util/FileUtils.java
+++ b/common/src/at/gv/egovernment/moa/util/FileUtils.java
@@ -99,14 +99,18 @@ public class FileUtils {
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();
+
+ if (url.startsWith("http:/") || url.startsWith("https:/") || url.startsWith("file:/") || url.startsWith("ftp:/")) {
+ return url;
+ } else {
+ // 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;
}
- return newURL;
}
}