本文整理汇总了Java中com.sun.org.apache.xml.internal.resolver.helpers.PublicId.decodeURN方法的典型用法代码示例。如果您正苦于以下问题:Java PublicId.decodeURN方法的具体用法?Java PublicId.decodeURN怎么用?Java PublicId.decodeURN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xml.internal.resolver.helpers.PublicId
的用法示例。
在下文中一共展示了PublicId.decodeURN方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveSystem
import com.sun.org.apache.xml.internal.resolver.helpers.PublicId; //导入方法依赖的package包/类
/**
* Return the applicable SYSTEM system identifier.
*
* <p>If a SYSTEM entry exists in the Catalog
* for the system ID specified, return the mapped value.</p>
*
* <p>On Windows-based operating systems, the comparison between
* the system identifier provided and the SYSTEM entries in the
* Catalog is case-insensitive.</p>
*
* @param systemId The system ID to locate in the catalog.
*
* @return The resolved system identifier.
*
* @throws MalformedURLException The formal system identifier of a
* subordinate catalog cannot be turned into a valid URL.
* @throws IOException Error reading subordinate catalog file.
*/
public String resolveSystem(String systemId)
throws MalformedURLException, IOException {
catalogManager.debug.message(3, "resolveSystem("+systemId+")");
systemId = normalizeURI(systemId);
if (systemId != null && systemId.startsWith("urn:publicid:")) {
systemId = PublicId.decodeURN(systemId);
return resolvePublic(systemId, null);
}
// If there's a SYSTEM entry in this catalog, use it
if (systemId != null) {
String resolved = resolveLocalSystem(systemId);
if (resolved != null) {
return resolved;
}
}
// Otherwise, look in the subordinate catalogs
return resolveSubordinateCatalogs(SYSTEM,
null,
null,
systemId);
}
示例2: resolveURI
import com.sun.org.apache.xml.internal.resolver.helpers.PublicId; //导入方法依赖的package包/类
/**
* Return the applicable URI.
*
* <p>If a URI entry exists in the Catalog
* for the URI specified, return the mapped value.</p>
*
* <p>URI comparison is case sensitive.</p>
*
* @param uri The URI to locate in the catalog.
*
* @return The resolved URI.
*
* @throws MalformedURLException The system identifier of a
* subordinate catalog cannot be turned into a valid URL.
* @throws IOException Error reading subordinate catalog file.
*/
public String resolveURI(String uri)
throws MalformedURLException, IOException {
catalogManager.debug.message(3, "resolveURI("+uri+")");
uri = normalizeURI(uri);
if (uri != null && uri.startsWith("urn:publicid:")) {
uri = PublicId.decodeURN(uri);
return resolvePublic(uri, null);
}
// If there's a URI entry in this catalog, use it
if (uri != null) {
String resolved = resolveLocalURI(uri);
if (resolved != null) {
return resolved;
}
}
// Otherwise, look in the subordinate catalogs
return resolveSubordinateCatalogs(URI,
null,
null,
uri);
}