本文整理匯總了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;
}