Kaydet (Commit) 11efe49f authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS qadev21 (1.8.4); FILE MERGED

2005/01/11 16:39:07 cn 1.8.4.1: bugfix in getFullURL()
üst dbd19fe5
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: utils.java,v $ * $RCSfile: utils.java,v $
* *
* $Revision: 1.9 $ * $Revision: 1.10 $
* *
* last change:$Date: 2005-02-02 14:00:36 $ * last change:$Date: 2005-02-24 17:23:20 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -167,25 +167,23 @@ public class utils { ...@@ -167,25 +167,23 @@ public class utils {
public static String getFullURL( String sDocName ) { public static String getFullURL( String sDocName ) {
String fullDocPath = sDocName; String fullDocPath = sDocName;
// System.out.println("##### getFullURL (in): "+sDocName); fullDocPath = fullDocPath.replace('\\','/');
if (fullDocPath.startsWith("http:")) { if (fullDocPath.startsWith("http:")) {
return fullDocPath; return fullDocPath;
} }
if (fullDocPath.startsWith("file:")) {
return fullDocPath;
}
if (fullDocPath.startsWith("ftp:")) { if (fullDocPath.startsWith("ftp:")) {
return fullDocPath; return fullDocPath;
} }
fullDocPath = fullDocPath.replace('\\','/');
String prefix = ""; String prefix = "";
if (fullDocPath.startsWith("//")) { if (! fullDocPath.startsWith("file:///")){
prefix="file:"; if (fullDocPath.startsWith("//")) {
} else { prefix="file:";
if (fullDocPath.startsWith("/")) prefix="file://"; } else {
else prefix="file:///"; if (fullDocPath.startsWith("/")) prefix="file://";
else prefix="file:///";
}
} }
if (!fullDocPath.endsWith("/")) { if (!fullDocPath.endsWith("/")) {
File aFile = new File(fullDocPath); File aFile = new File(fullDocPath);
if (aFile.isDirectory()) { if (aFile.isDirectory()) {
...@@ -193,7 +191,7 @@ public class utils { ...@@ -193,7 +191,7 @@ public class utils {
} }
} }
String fulldocURL = prefix+fullDocPath; String fulldocURL = prefix+fullDocPath;
// System.out.println("##### getFullURL (out): "+fulldocURL);
return fulldocURL; return fulldocURL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment