本文整理汇总了Java中org.eclipse.emf.common.util.URI.createHierarchicalURI方法的典型用法代码示例。如果您正苦于以下问题:Java URI.createHierarchicalURI方法的具体用法?Java URI.createHierarchicalURI怎么用?Java URI.createHierarchicalURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.common.util.URI
的用法示例。
在下文中一共展示了URI.createHierarchicalURI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createInputStream
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
@Override
public InputStream createInputStream(URI uri, Map<?, ?> options) throws IOException {
String[] allSegments = new String[uri.segmentCount() + 1];
allSegments[0] = "env";
for (int i = 0; i < uri.segmentCount(); i++) {
allSegments[i + 1] = uri.segment(i);
}
URI classpathURI = URI.createHierarchicalURI(
ClasspathUriUtil.CLASSPATH_SCHEME,
uri.authority(),
uri.device(),
allSegments,
uri.query(),
uri.fragment());
URI resolvedURI = uriResolver.resolve(classLoader, classpathURI);
return original.createInputStream(resolvedURI, options);
}
示例2: create
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
/**
* Create a new URI with fragment.
*/
private static URI create(String path, String fragment) {
List<String> segments = Strings.split(path, '/');
URI result = URI.createHierarchicalURI(SCHEME, null, null,
segments.toArray(new String[segments.size()]), null, fragment);
return result;
}
示例3: createURI
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
/**
* Creates a new archive URI that points to the given archive entry.
*
* @param archiveFile
* the uri to the archive
* @param entry
* the entry
* @return a URI that points to the entry
*
* @see URI#createHierarchicalURI(String, String, String, String[], String, String)
*/
public static URI createURI(URI archiveFile, ZipEntry entry) {
String entryName = entry.getName();
List<String> segmentList = Strings.split(entryName, '/');
String[] segments = segmentList.toArray(new String[segmentList.size()]);
URI result = URI.createHierarchicalURI(
"archive",
archiveFile.toString() + "!",
null,
segments,
null,
null);
return result;
}