本文整理汇总了Java中com.aelitis.azureus.core.vuzefile.VuzeFile.getComponents方法的典型用法代码示例。如果您正苦于以下问题:Java VuzeFile.getComponents方法的具体用法?Java VuzeFile.getComponents怎么用?Java VuzeFile.getComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.aelitis.azureus.core.vuzefile.VuzeFile
的用法示例。
在下文中一共展示了VuzeFile.getComponents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadFromVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入方法依赖的package包/类
public Engine[]
loadFromVuzeFile(
VuzeFile vf )
{
List<Engine> result = new ArrayList<Engine>();
VuzeFileComponent[] comps = vf.getComponents();
for (int j=0;j<comps.length;j++){
VuzeFileComponent comp = comps[j];
if ( comp.getType() == VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE ){
try{
result.add( importEngine( comp.getContent(), false ));
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
}
return(result.toArray(new Engine[result.size()]));
}
示例2: getSubscriptionFromVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入方法依赖的package包/类
protected SubscriptionImpl
getSubscriptionFromVuzeFile(
byte[] sid,
int add_type,
VuzeFile vf )
throws SubscriptionException
{
VuzeFileComponent[] comps = vf.getComponents();
for (int j=0;j<comps.length;j++){
VuzeFileComponent comp = comps[j];
if ( comp.getType() == VuzeFileComponent.COMP_TYPE_SUBSCRIPTION ){
Map map = comp.getContent();
try{
SubscriptionBodyImpl body = new SubscriptionBodyImpl( SubscriptionManagerImpl.this, map );
SubscriptionImpl new_subs = new SubscriptionImpl( SubscriptionManagerImpl.this, body, add_type, false );
if ( Arrays.equals( new_subs.getShortID(), sid )){
return( new_subs );
}
}catch( Throwable e ){
log( "Subscription decode failed", e );
}
}
}
throw( new SubscriptionException( "Subscription not found" ));
}