INTEGRATION: CWS fwk03 (1.3.8); FILE MERGED

2003/05/16 07:41:58 dbo 1.3.8.1: #109701# internal StringHelper class
This commit is contained in:
Vladimir Glazounov 2003-05-26 07:40:18 +00:00
parent 501ad56a97
commit 23805649ad

View file

@ -2,9 +2,9 @@
*
* $RCSfile: NativeLibraryLoader.java,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: vg $ $Date: 2003-05-22 08:56:11 $
* last change: $Author: vg $ $Date: 2003-05-26 08:40:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -183,8 +183,8 @@ public final class NativeLibraryLoader {
return url.getProtocol().equalsIgnoreCase("file")
&& url.getAuthority() == null && url.getQuery() == null
&& url.getRef() == null
? new File(URLDecoder.decode(replace(url.getPath(), '+',
"%2B")))
? new File(URLDecoder.decode(
StringHelper.replace(url.getPath(), '+', "%2B")))
: null;
} else {
// If java.net.URI is avaliable, do
@ -223,20 +223,4 @@ public final class NativeLibraryLoader {
}
}
}
private static String replace(String str, char from, String to) {
StringBuffer b = new StringBuffer();
for (int i = 0;;) {
int j = str.indexOf(from, i);
if (j == -1) {
b.append(str.substring(i));
break;
} else {
b.append(str.substring(i, j));
b.append(to);
i = j + 1;
}
}
return b.toString();
}
}