本文整理汇总了Java中jdk.internal.jimage.ImageReader.Node.isLink方法的典型用法代码示例。如果您正苦于以下问题:Java Node.isLink方法的具体用法?Java Node.isLink怎么用?Java Node.isLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.internal.jimage.ImageReader.Node
的用法示例。
在下文中一共展示了Node.isLink方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookupSymbolic
import jdk.internal.jimage.ImageReader.Node; //导入方法依赖的package包/类
private Node lookupSymbolic(String path) {
int i = 1;
while (i < path.length()) {
i = path.indexOf('/', i);
if (i == -1) {
break;
}
String prefix = path.substring(0, i);
Node node = lookup(prefix);
if (node == null) {
break;
}
if (node.isLink()) {
Node link = node.resolveLink(true);
// resolved symbolic path concatenated to the rest of the path
String resPath = link.getName() + path.substring(i);
node = lookup(resPath);
return node != null ? node : lookupSymbolic(resPath);
}
i++;
}
return null;
}
示例2: resolveLink
import jdk.internal.jimage.ImageReader.Node; //导入方法依赖的package包/类
JrtPath resolveLink(JrtPath path) throws IOException {
Node node = checkNode(path);
if (node.isLink()) {
node = node.resolveLink();
return new JrtPath(this, node.getName()); // TBD, normalized?
}
return path;
}
示例3: getFileAttributes
import jdk.internal.jimage.ImageReader.Node; //导入方法依赖的package包/类
JrtFileAttributes getFileAttributes(JrtPath path, LinkOption... options)
throws IOException {
Node node = checkNode(path);
if (node.isLink() && followLinks(options)) {
return new JrtFileAttributes(node.resolveLink(true));
}
return new JrtFileAttributes(node);
}
示例4: isDirectory
import jdk.internal.jimage.ImageReader.Node; //导入方法依赖的package包/类
boolean isDirectory(JrtPath path, boolean resolveLinks)
throws IOException {
Node node = checkNode(path);
return resolveLinks && node.isLink()
? node.resolveLink(true).isDirectory()
: node.isDirectory();
}
示例5: toRealPath
import jdk.internal.jimage.ImageReader.Node; //导入方法依赖的package包/类
JrtPath toRealPath(JrtPath path, LinkOption... options)
throws IOException {
Node node = checkNode(path);
if (followLinks(options) && node.isLink()) {
node = node.resolveLink();
}
// image node holds the real/absolute path name
return new JrtPath(this, node.getName(), true);
}
示例6: findNode
import jdk.internal.jimage.ImageReader.Node; //导入方法依赖的package包/类
@Override
public synchronized Node findNode(String str) {
Node node = findModulesNode(str);
if (node != null) {
return node;
}
// lazily created for paths like /packages/<package>/<module>/xyz
// For example /packages/java.lang/java.base/java/lang/
if (str.startsWith(PACKAGES)) {
// pkgEndIdx marks end of <package> part
int pkgEndIdx = str.indexOf('/', PACKAGES_LEN);
if (pkgEndIdx != -1) {
// modEndIdx marks end of <module> part
int modEndIdx = str.indexOf('/', pkgEndIdx + 1);
if (modEndIdx != -1) {
// make sure we have such module link!
// ie., /packages/<package>/<module> is valid
Node linkNode = nodes.get(str.substring(0, modEndIdx));
if (linkNode == null || !linkNode.isLink()) {
return null;
}
// map to "/modules/zyz" path and return that node
// For example, "/modules/java.base/java/lang" for
// "/packages/java.lang/java.base/java/lang".
String mod = MODULES + str.substring(pkgEndIdx + 1);
return findModulesNode(mod);
}
}
}
return null;
}