当前位置: 首页>>代码示例>>Java>>正文


Java VuzeFileHandler类代码示例

本文整理汇总了Java中com.aelitis.azureus.core.vuzefile.VuzeFileHandler的典型用法代码示例。如果您正苦于以下问题:Java VuzeFileHandler类的具体用法?Java VuzeFileHandler怎么用?Java VuzeFileHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VuzeFileHandler类属于com.aelitis.azureus.core.vuzefile包,在下文中一共展示了VuzeFileHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSubscriptionFromVuzeFile

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 ));
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:24,代码来源:SubscriptionManagerImpl.java

示例2: getSubscriptionFromVuzeFileContent

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 ));
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:22,代码来源:SubscriptionManagerImpl.java

示例3: SubscriptionBodyImpl

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 );
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:27,代码来源:SubscriptionBodyImpl.java

示例4: main

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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();
 	}
 }
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:24,代码来源:MetaSearchManagerImpl.java

示例5: preInitialise

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 );
							}
						}
					}
				}
			}
		});		
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:41,代码来源:ContentNetworkManagerImpl.java

示例6: exportCustomization

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 ));
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:40,代码来源:CustomizationManagerImpl.java

示例7: getVuzeFile

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 ));
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:14,代码来源:SubscriptionImpl.java

示例8: updateSubscription

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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 );
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:14,代码来源:SubscriptionManagerImpl.java

示例9: main

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的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();
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:40,代码来源:SubscriptionManagerImpl.java

示例10: exportToVuzeFile

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的package包/类
public void
exportToVuzeFile(
	File	target )

	throws IOException
{
	VuzeFile	vf = VuzeFileHandler.getSingleton().create();
	
	vf.addComponent(
		VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE,
		exportToBencodedMap());
	
	vf.write( target );
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:15,代码来源:EngineImpl.java

示例11: loadFromVuzeFile

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的package包/类
public Engine[]
loadFromVuzeFile(
	File		file )
{
	VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile( file.getAbsolutePath());
	
	if ( vf != null ){
		
		return( loadFromVuzeFile( vf ));
	}
	
	return( new Engine[0]);
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:14,代码来源:MetaSearchManagerImpl.java

示例12: connect

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的package包/类
public void 
connect() 
	throws IOException 
{
	String str = url.toExternalForm();
	
	int	pos = str.indexOf( "=" );
	
	str = str.substring( pos+1 );
	
	byte[]	bytes = str.getBytes( Constants.BYTE_ENCODING );
	
	VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile( bytes );
	
	if ( vf == null ){
		
		throw( new IOException( "Invalid vuze file" ));
	}
	
	input_stream = new ByteArrayInputStream( bytes );
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:22,代码来源:VuzeURLConnection.java

示例13: PluginInstallerImpl

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的package包/类
protected
PluginInstallerImpl(
	PluginManager	_manager )
{
	manager	= _manager;
	
	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_PLUGIN ){
								
								try{
									Map	content = comp.getContent();
									
									String	id 		= new String((byte[])content.get( "id" ), "UTF-8" );
									String	version = new String((byte[])content.get( "version" ), "UTF-8" );
									String	suffix	= ((Long)content.get( "is_jar" )).longValue()==1?"jar":"zip";
									
									byte[]	plugin_file = (byte[])content.get( "file" );
									
									File temp_dir = AETemporaryFileHandler.createTempDir();
									
									File temp_file = new File( temp_dir, id + "_" + version + "." + suffix );
									
									FileUtil.copyFile( new ByteArrayInputStream( plugin_file ), temp_file );

									FilePluginInstaller installer = installFromFile( temp_file );

									addFileInstallOperation( installer );
									
									comp.setProcessed();
									
								}catch( Throwable e ){
									
									Debug.printStackTrace(e);
								}
							}
						}
					}
				}
			});
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:58,代码来源:PluginInstallerImpl.java

示例14: getVuzeFile

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的package包/类
public VuzeFile
getVuzeFile()
{
	VuzeFile	vf = VuzeFileHandler.getSingleton().create();
	
	Map	map = new HashMap();
	
	try{
		exportToBEncodedMap( map );
	
		vf.addComponent( VuzeFileComponent.COMP_TYPE_CONTENT_NETWORK, map );
		
	}catch( Throwable e ){
		
		Debug.printStackTrace( e );
	}
	
	return( vf );
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:20,代码来源:ContentNetworkImpl.java

示例15: main

import com.aelitis.azureus.core.vuzefile.VuzeFileHandler; //导入依赖的package包/类
public static void
main(
	String[]		args )
{
	/*
	try{
		CustomizationManagerImpl	manager = (CustomizationManagerImpl)getSingleton();
		
		CustomizationImpl cust = new CustomizationImpl( manager, "blah", "1.2", new File( "C:\\temp\\cust\\details.zip" ));
	
		cust.exportToVuzeFile( new File( "C:\\temp\\cust" ));
		
	}catch( Throwable e ){
		
		e.printStackTrace();
	}
	*/
	
	try{
		VuzeFile	vf = VuzeFileHandler.getSingleton().create();
		
		Map	config = new HashMap();
		
		List list = new ArrayList();
		
		list.add( "trout" );
		list.add( 45 );
		
		config.put( "test.a10", "Hello mum" );
		config.put( "test.a11", new Long(100));
		config.put( "test.a13", list );
		
		Map	map = new HashMap();
		
		map.put( "name", "My Proxy Settings" );
		map.put( "settings", config );
		map.put( "restart", new Long( 1 ));
		
		vf.addComponent( VuzeFileComponent.COMP_TYPE_CONFIG_SETTINGS, map );
		
		vf.write( new File( "C:\\temp\\p_config.vuze" ) );
		
	}catch( Throwable e ){
		
		e.printStackTrace();
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:48,代码来源:CustomizationManagerImpl.java


注:本文中的com.aelitis.azureus.core.vuzefile.VuzeFileHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。