本文整理汇总了Java中com.aelitis.azureus.core.vuzefile.VuzeFile.write方法的典型用法代码示例。如果您正苦于以下问题:Java VuzeFile.write方法的具体用法?Java VuzeFile.write怎么用?Java VuzeFile.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.aelitis.azureus.core.vuzefile.VuzeFile
的用法示例。
在下文中一共展示了VuzeFile.write方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
}
示例2: 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 ));
}
}
示例3: 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();
}
}
示例4: 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 );
}
示例5: main
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入方法依赖的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();
}
}
示例6: main
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入方法依赖的package包/类
public static void
main(
String[] args )
{
try{
VuzeFile vf = VuzeFileHandler.getSingleton().create();
Map content = new HashMap();
List commands = new ArrayList();
content.put( "commands", commands );
// home tab
Map command1 = new HashMap();
commands.add( command1 );
List l_args1 = new ArrayList();
//l_args1.add( SkinConstants.VIEWID_HOME_TAB );
command1.put( "type", new Long( COMMAND_SWITCH_TO_TAB ));
command1.put( "args", l_args1 );
// activity tab
Map command2 = new HashMap();
commands.add( command2 );
List l_args2 = new ArrayList();
//l_args2.add( SkinConstants.VIEWID_ACTIVITY_TAB );
command2.put( "type", new Long( COMMAND_SWITCH_TO_TAB ));
command2.put( "args", l_args2 );
// check plugin available
Map command3 = new HashMap();
commands.add( command3 );
List l_args3 = new ArrayList();
command3.put( "type", new Long( COMMAND_CONDITION_CHECK ));
command3.put( "args", l_args3 );
vf.addComponent( VuzeFileComponent.COMP_TYPE_V3_NAVIGATION, content );
vf.write( new File( "C:\\temp\\v3ui.vuze" ));
}catch( Throwable e ){
e.printStackTrace();
}
}
示例7: getTorrent
import com.aelitis.azureus.core.vuzefile.VuzeFile; //导入方法依赖的package包/类
public TOTorrent
getTorrent()
{
synchronized( this ){
if ( torrent == null ){
// hack alert - we embed the vuze-file into a torrent to allow it to go through
// the normal share route, then pick it out again when the recipient 'downloads' it
try{
VuzeFile vf = subs.getVuzeFile();
// if not corrupt....
if ( vf != null ){
File f1 = AETemporaryFileHandler.createTempFile();
File f = new File( f1.getParent(), "Update Vuze to access this share_" + f1.getName());
f1.delete();
try{
vf.write( f );
TOTorrentCreator cr = TOTorrentFactory.createFromFileOrDirWithComputedPieceLength( f, new URL( "dht://" ));
TOTorrent temp = cr.create();
Map vuze_map = vf.exportToMap();
Map torrent_map = temp.serialiseToMap();
torrent_map.putAll( vuze_map );
torrent = TOTorrentFactory.deserialiseFromMap( torrent_map );
}finally{
f.delete();
}
}
}catch( Throwable e ){
Debug.out( e );
}
}
}
return( torrent );
}
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:54,代码来源:SubscriptionSelectedContent.java