本文整理汇总了Java中org.red5.server.api.scope.IScope.hasChildScope方法的典型用法代码示例。如果您正苦于以下问题:Java IScope.hasChildScope方法的具体用法?Java IScope.hasChildScope怎么用?Java IScope.hasChildScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.red5.server.api.scope.IScope
的用法示例。
在下文中一共展示了IScope.hasChildScope方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveScope
import org.red5.server.api.scope.IScope; //导入方法依赖的package包/类
/**
* Resolves scope for specified scope and path.
*
* @param from
* Scope to use as context (to start from)
* @param path
* Path to resolve
* @return Resolved scope
*/
public static IScope resolveScope(IScope from, String path) {
log.debug("resolveScope from: {} path: {}", from.getName(), path);
IScope current = from;
if (path.startsWith(SLASH)) {
current = ScopeUtils.findRoot(current);
path = path.substring(1, path.length());
}
if (path.endsWith(SLASH)) {
path = path.substring(0, path.length() - 1);
}
log.trace("Current: {}", current);
String[] parts = path.split(SLASH);
if (log.isTraceEnabled()) {
log.trace("Parts: {}", Arrays.toString(parts));
}
for (String part : parts) {
log.trace("Part: {}", part);
if (part.equals(".")) {
continue;
}
if (part.equals("..")) {
if (!current.hasParent()) {
return null;
}
current = current.getParent();
continue;
}
if (!current.hasChildScope(part)) {
return null;
}
current = current.getScope(part);
log.trace("Current: {}", current);
}
return current;
}
示例2: hasSharedObject
import org.red5.server.api.scope.IScope; //导入方法依赖的package包/类
/** {@inheritDoc} */
public boolean hasSharedObject(IScope scope, String name) {
return scope.hasChildScope(ScopeType.SHARED_OBJECT, name);
}