本文整理汇总了Java中com.aelitis.azureus.core.vuzefile.VuzeFile类的典型用法代码示例。如果您正苦于以下问题:Java VuzeFile类的具体用法?Java VuzeFile怎么用?Java VuzeFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VuzeFile类属于com.aelitis.azureus.core.vuzefile包,在下文中一共展示了VuzeFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubscriptionFromVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
protected SubscriptionImpl
getSubscriptionFromVuzeFile(
byte[] sid,
int add_type,
File file )
throws SubscriptionException
{
VuzeFileHandler vfh = VuzeFileHandler.getSingleton();
String file_str = file.getAbsolutePath();
VuzeFile vf = vfh.loadVuzeFile( file_str );
if ( vf == null ){
log( "Failed to load vuze file from " + file_str );
throw( new SubscriptionException( "Failed to load vuze file from " + file_str ));
}
return( getSubscriptionFromVuzeFile( sid, add_type, vf ));
}
示例2: getSubscriptionFromVuzeFileContent
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
protected SubscriptionImpl
getSubscriptionFromVuzeFileContent(
byte[] sid,
int add_type,
String content )
throws SubscriptionException
{
VuzeFileHandler vfh = VuzeFileHandler.getSingleton();
VuzeFile vf = vfh.loadVuzeFile( Base64.decode( content ));
if ( vf == null ){
log( "Failed to load vuze file from " + content );
throw( new SubscriptionException( "Failed to load vuze file from content" ));
}
return( getSubscriptionFromVuzeFile( sid, add_type, vf ));
}
示例3: SubscriptionBodyImpl
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
protected
SubscriptionBodyImpl(
SubscriptionManagerImpl _manager,
SubscriptionImpl _subs )
throws SubscriptionException
{
manager = _manager;
try{
File vuze_file = manager.getVuzeFile( _subs );
VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile( vuze_file.getAbsolutePath());
if ( vf == null ){
throw( new IOException( "Failed to load vuze file '" + vuze_file + "'" ));
}
load( vf.getComponents()[0].getContent(), false );
}catch( Throwable e ){
rethrow( e );
}
}
示例4: 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()]));
}
示例5: main
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public static void
main(
String[] args )
{
try{
VuzeFile vf = VuzeFileHandler.getSingleton().create();
Map contents = new HashMap();
contents.put( "type", new Long( 1 ));
contents.put( "term", "donkey" );
vf.addComponent(
VuzeFileComponent.COMP_TYPE_METASEARCH_OPERATION,
contents);
vf.write( new File( "C:\\temp\\search.vuze" ));
}catch( Throwable e ){
e.printStackTrace();
}
}
示例6: getSearchTemplateVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public VuzeFile
getSearchTemplateVuzeFile()
{
if ( !isSearchTemplate()){
return( null );
}
Object[] details = manager.getSearchTemplateVuzeFile( this );
if ( details != null ){
return((VuzeFile)details[0]);
}
return( null );
}
示例7: preInitialise
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public static void
preInitialise()
{
VuzeFileHandler.getSingleton().addProcessor(
new VuzeFileProcessor()
{
public void
process(
VuzeFile[] files,
int expected_types )
{
for (int i=0;i<files.length;i++){
VuzeFile vf = files[i];
VuzeFileComponent[] comps = vf.getComponents();
for (int j=0;j<comps.length;j++){
VuzeFileComponent comp = comps[j];
if ( comp.getType() == VuzeFileComponent.COMP_TYPE_CONTENT_NETWORK ){
try{
((ContentNetworkManagerImpl)getSingleton()).importNetwork( comp.getContent());
comp.setProcessed();
}catch( Throwable e ){
log( "Failed to import from vuze file", e );
Debug.out( e );
}
}
}
}
}
});
}
示例8: exportCustomization
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
protected void
exportCustomization(
CustomizationImpl cust,
File to_file )
throws CustomizationException
{
if ( to_file.isDirectory()){
to_file = new File( to_file, cust.getName() + "_" + cust.getVersion() + ".vuze");
}
if ( !to_file.getName().endsWith( ".vuze" )){
to_file = new File( to_file.getParentFile(), to_file.getName() + ".vuze" );
}
try{
Map contents = new HashMap();
byte[] data = FileUtil.readFileAsByteArray( cust.getContents());
contents.put( "name", cust.getName());
contents.put( "version", cust.getVersion());
contents.put( "data", data );
VuzeFile vf = VuzeFileHandler.getSingleton().create();
vf.addComponent(
VuzeFileComponent.COMP_TYPE_CUSTOMIZATION,
contents);
vf.write( to_file );
}catch( Throwable e ){
throw( new CustomizationException( "Failed to export customization", e ));
}
}
示例9: getVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public VuzeFile
getVuzeFile()
throws SubscriptionException
{
try{
return( VuzeFileHandler.getSingleton().loadVuzeFile( manager.getVuzeFile( this ).getAbsolutePath()));
}catch( Throwable e ){
throw( new SubscriptionException( "Failed to get Vuze file", e ));
}
}
示例10: updateSubscription
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
protected void
updateSubscription(
SubscriptionImpl subs,
File data_location )
{
log( "Updating subscription '" + subs.getString() + " using '" + data_location + "'" );
VuzeFileHandler vfh = VuzeFileHandler.getSingleton();
VuzeFile vf = vfh.loadVuzeFile( data_location.getAbsolutePath());
vfh.handleFiles( new VuzeFile[]{ vf }, VuzeFileComponent.COMP_TYPE_SUBSCRIPTION );
}
示例11: main
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public static void
main(
String[] args )
{
final String NAME = "lalalal";
final String URL_STR = "http://www.vuze.com/feed/publisher/ALL/1";
try{
//AzureusCoreFactory.create();
/*
Subscription subs =
getSingleton(true).createSingletonRSS(
NAME,
new URL( URL_STR ),
240 );
subs.getVuzeFile().write( new File( "C:\\temp\\srss.vuze" ));
subs.remove();
*/
VuzeFile vf = VuzeFileHandler.getSingleton().create();
Map map = new HashMap();
map.put( "name", NAME );
map.put( "url", URL_STR );
map.put( "public", new Long( 0 ));
map.put( "check_interval_mins", new Long( 345 ));
vf.addComponent( VuzeFileComponent.COMP_TYPE_SUBSCRIPTION_SINGLETON, map );
vf.write( new File( "C:\\temp\\srss_2.vuze" ) );
}catch( Throwable e ){
e.printStackTrace();
}
}
示例12: exportToVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public void
exportToVuzeFile(
File target )
throws IOException
{
VuzeFile vf = VuzeFileHandler.getSingleton().create();
vf.addComponent(
VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE,
exportToBencodedMap());
vf.write( target );
}
示例13: checkPotentialAssociations
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
private void
checkPotentialAssociations(
byte[] hash,
String key )
{
EngineImpl engine;
synchronized( potential_associations ){
engine = potential_associations.remove( key );
}
if ( engine != null ){
try{
VuzeFile vf = engine.exportToVuzeFile( true );
byte[] bytes = vf.exportToBytes();
String url_str = "vuze://?body=" + new String( bytes, Constants.BYTE_ENCODING );
SubscriptionManager sub_man = SubscriptionManagerFactory.getSingleton();
Subscription subs =
sub_man.createSingletonRSS(
vf.getName() + ": " + engine.getName() + " (v" + engine.getVersion() + ")",
new URL( url_str ),
Integer.MAX_VALUE );
subs.setSubscribed( true );
subs.addAssociation( hash );
}catch( Throwable e ){
Debug.out( e );
}
}
}
示例14: getVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public VuzeFile
getVuzeFile()
throws IOException
{
return( manager.exportVuzeFile( this ));
}
示例15: getVuzeFile
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入依赖的package包/类
public VuzeFile
getVuzeFile()
{
try{
return( subs.getVuzeFile());
}catch( Throwable e ){
Debug.out(e);
}
return( null );
}
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:14,代码来源:SubscriptionSelectedContent.java