当前位置:   article > 正文

java urldecodeutil_Java UrlUtil.decode方法代碼示例

util.decode

本文整理匯總了Java中com.sun.jndi.toolkit.url.UrlUtil.decode方法的典型用法代碼示例。如果您正苦於以下問題:Java UrlUtil.decode方法的具體用法?Java UrlUtil.decode怎麽用?Java UrlUtil.decode使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.jndi.toolkit.url.UrlUtil的用法示例。

在下文中一共展示了UrlUtil.decode方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: DnsUrl

​點讚 3

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

public DnsUrl(String url) throws MalformedURLException {

super(url);

if (!scheme.equals("dns")) {

throw new MalformedURLException(

url + " is not a valid DNS pseudo-URL");

}

domain = path.startsWith("/")

? path.substring(1)

: path;

domain = domain.equals("")

? "."

: UrlUtil.decode(domain);

// Debug

// System.out.println("host=" + host + " port=" + port +

// " domain=" + domain);

}

開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:20,

示例2: IiopUrl

​點讚 2

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

public IiopUrl(String url) throws MalformedURLException {

int addrStart;

boolean oldFormat;

if (url.startsWith("iiopname://")) {

oldFormat = false;

addrStart = 11;

} else if (url.startsWith("iiop://")) {

oldFormat = true;

addrStart = 7;

} else {

throw new MalformedURLException("Invalid iiop/iiopname URL: " + url);

}

int addrEnd = url.indexOf('/', addrStart);

if (addrEnd < 0) {

addrEnd = url.length();

stringName = "";

} else {

stringName = UrlUtil.decode(url.substring(addrEnd+1));

}

addresses = new Vector<>(3);

if (oldFormat) {

// Only one host:port part, not multiple

addresses.addElement(

new Address(url.substring(addrStart, addrEnd), oldFormat));

} else {

StringTokenizer tokens =

new StringTokenizer(url.substring(addrStart, addrEnd), ",");

while (tokens.hasMoreTokens()) {

addresses.addElement(new Address(tokens.nextToken(), oldFormat));

}

if (addresses.size() == 0) {

addresses.addElement(new Address("", oldFormat));

}

}

}

開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:37,

示例3: CorbanameUrl

​點讚 2

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

public CorbanameUrl(String url) throws MalformedURLException {

if (!url.startsWith("corbaname:")) {

throw new MalformedURLException("Invalid corbaname URL: " + url);

}

int addrStart = 10; // "corbaname:"

int addrEnd = url.indexOf('#', addrStart);

if (addrEnd < 0) {

addrEnd = url.length();

stringName = "";

} else {

stringName = UrlUtil.decode(url.substring(addrEnd+1));

}

location = url.substring(addrStart, addrEnd);

int keyStart = location.indexOf("/");

if (keyStart >= 0) {

// Has key string

if (keyStart == (location.length() -1)) {

location += "NameService";

}

} else {

location += "/NameService";

}

}

開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:28,

示例4: CorbanameUrl

​點讚 2

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

public CorbanameUrl(String url) throws MalformedURLException {

if (!url.startsWith("corbaname:")) {

throw new MalformedURLException("Invalid corbaname URL: " + url);

}

int addrStart = 10; // "corbaname:"

int addrEnd = url.indexOf('#', addrStart);

if (addrEnd < 0) {

addrEnd = url.length();

stringName = "";

} else {

stringName = UrlUtil.decode(url.substring(addrEnd+1));

}

location = url.substring(addrStart, addrEnd);

int keyStart = location.indexOf('/');

if (keyStart >= 0) {

// Has key string

if (keyStart == (location.length() -1)) {

location += "NameService";

}

} else {

location += "/NameService";

}

}

開發者ID:campolake,項目名稱:openjdk9,代碼行數:28,

示例5: IiopUrl

​點讚 2

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

public IiopUrl(String url) throws MalformedURLException {

int addrStart;

boolean oldFormat;

if (url.startsWith("iiopname://")) {

oldFormat = false;

addrStart = 11;

} else if (url.startsWith("iiop://")) {

oldFormat = true;

addrStart = 7;

} else {

throw new MalformedURLException("Invalid iiop/iiopname URL: " + url);

}

int addrEnd = url.indexOf('/', addrStart);

if (addrEnd < 0) {

addrEnd = url.length();

stringName = "";

} else {

stringName = UrlUtil.decode(url.substring(addrEnd+1));

}

addresses = new Vector(3);

if (oldFormat) {

// Only one host:port part, not multiple

addresses.addElement(

new Address(url.substring(addrStart, addrEnd), oldFormat));

} else {

StringTokenizer tokens =

new StringTokenizer(url.substring(addrStart, addrEnd), ",");

while (tokens.hasMoreTokens()) {

addresses.addElement(new Address(tokens.nextToken(), oldFormat));

}

if (addresses.size() == 0) {

addresses.addElement(new Address("", oldFormat));

}

}

}

開發者ID:openjdk,項目名稱:jdk7-jdk,代碼行數:37,

示例6: parsePathAndQuery

​點讚 2

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

private void parsePathAndQuery() throws MalformedURLException,

UnsupportedEncodingException {

// path begins with a '/' or is empty

if (path.equals("")) {

return;

}

DN = path.startsWith("/") ? path.substring(1) : path;

if (DN.length() > 0) {

DN = UrlUtil.decode(DN, "UTF8");

}

// query begins with a '?' or is null

if (query == null) {

return;

}

int qmark2 = query.indexOf('?', 1);

if (qmark2 < 0) {

attributes = query.substring(1);

return;

} else if (qmark2 != 1) {

attributes = query.substring(1, qmark2);

}

int qmark3 = query.indexOf('?', qmark2 + 1);

if (qmark3 < 0) {

scope = query.substring(qmark2 + 1);

return;

} else if (qmark3 != qmark2 + 1) {

scope = query.substring(qmark2 + 1, qmark3);

}

int qmark4 = query.indexOf('?', qmark3 + 1);

if (qmark4 < 0) {

filter = query.substring(qmark3 + 1);

} else {

if (qmark4 != qmark3 + 1) {

filter = query.substring(qmark3 + 1, qmark4);

}

extensions = query.substring(qmark4 + 1);

if (extensions.length() > 0) {

extensions = UrlUtil.decode(extensions, "UTF8");

}

}

if (filter != null && filter.length() > 0) {

filter = UrlUtil.decode(filter, "UTF8");

}

}

開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:56,

示例7: parsePathAndQuery

​點讚 2

import com.sun.jndi.toolkit.url.UrlUtil; //導入方法依賴的package包/類

private void parsePathAndQuery() throws MalformedURLException,

UnsupportedEncodingException {

// path begins with a '/' or is empty

if (path.equals("")) {

return;

}

DN = path.startsWith("/") ? path.substring(1) : path;

if (DN.length() > 0) {

DN = UrlUtil.decode(DN, "UTF8");

}

// query begins with a '?' or is null

if (query == null || query.length() < 2) {

return;

}

int currentIndex = 1;

int nextQmark;

int endIndex;

// attributes:

nextQmark = query.indexOf('?', currentIndex);

endIndex = nextQmark == -1 ? query.length() : nextQmark;

if (endIndex - currentIndex > 0) {

attributes = query.substring(currentIndex, endIndex);

}

currentIndex = endIndex + 1;

if (currentIndex >= query.length()) {

return;

}

// scope:

nextQmark = query.indexOf('?', currentIndex);

endIndex = nextQmark == -1 ? query.length() : nextQmark;

if (endIndex - currentIndex > 0) {

scope = query.substring(currentIndex, endIndex);

}

currentIndex = endIndex + 1;

if (currentIndex >= query.length()) {

return;

}

// filter:

nextQmark = query.indexOf('?', currentIndex);

endIndex = nextQmark == -1 ? query.length() : nextQmark;

if (endIndex - currentIndex > 0) {

filter = query.substring(currentIndex, endIndex);

filter = UrlUtil.decode(filter, "UTF8");

}

currentIndex = endIndex + 1;

if (currentIndex >= query.length()) {

return;

}

// extensions:

if (query.length() - currentIndex > 0) {

extensions = query.substring(currentIndex);

extensions = UrlUtil.decode(extensions, "UTF8");

}

}

開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:65,

注:本文中的com.sun.jndi.toolkit.url.UrlUtil.decode方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/202835?site
推荐阅读
相关标签
  

闽ICP备14008679号