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(); } } }
vf.write( new File( "C:\\temp\\v3ui.vuze" ));
vf.write( new File( "C:\\temp\\p_config.vuze" ) );
@Override public void exportToVuzeFile( File target ) throws IOException { VuzeFile vf = VuzeFileHandler.getSingleton().create(); vf.addComponent( VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE, exportToBencodedMap()); vf.write( target ); }
vf.write( f );
protected void exportCustomization( CustomizationImpl cust, File to_file ) throws CustomizationException { if ( to_file.isDirectory()){ to_file = new File( to_file, VuzeFileHandler.getVuzeFileName( cust.getName() + "_" + cust.getVersion())); } if ( !VuzeFileHandler.isAcceptedVuzeFileName( to_file.getName())){ to_file = new File( to_file.getParentFile(), VuzeFileHandler.getVuzeFileName( to_file.getName())); } 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 )); } }
target.write( output_file );
vf.write( file );
@Override public void exportEngines( File target ) throws MetaSearchException { Engine[] engines = getEngines( true, false ); VuzeFile vf = VuzeFileHandler.getSingleton().create(); for ( Engine engine: engines ){ try{ vf.addComponent( VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE, engine.exportToBencodedMap()); }catch( IOException e ){ Debug.out( e ); } } try{ vf.write( target ); }catch( IOException e ){ throw( new MetaSearchException( "Failed to write file", e )); } }
@Override public void runSupport() { FileDialog dialog = new FileDialog( Utils.findAnyShell(), SWT.SYSTEM_MODAL | SWT.SAVE ); dialog.setFilterPath( TorrentOpener.getFilterPathData() ); dialog.setText(MessageText.getString("subscript.export.select.template.file")); dialog.setFilterExtensions(VuzeFileHandler.getVuzeFileFilterExtensions()); dialog.setFilterNames(VuzeFileHandler.getVuzeFileFilterExtensions()); String path = TorrentOpener.setFilterPathData( dialog.open()); if ( path != null ){ if ( !VuzeFileHandler.isAcceptedVuzeFileName( path )){ path = VuzeFileHandler.getVuzeFileName( path ); } try{ VuzeFile vf = subs.getVuzeFile(); vf.write( new File( path )); }catch( Throwable e ){ Debug.out( e ); } } } });
@Override public void runSupport() { FileDialog dialog = new FileDialog( Utils.findAnyShell(), SWT.SYSTEM_MODAL | SWT.SAVE ); dialog.setFilterPath( TorrentOpener.getFilterPathData() ); dialog.setText(MessageText.getString("device.export.select.template.file")); dialog.setFilterExtensions( VuzeFileHandler.getVuzeFileFilterExtensions()); dialog.setFilterNames( VuzeFileHandler.getVuzeFileFilterExtensions()); String path = TorrentOpener.setFilterPathData( dialog.open()); if ( path != null ){ if ( !VuzeFileHandler.isAcceptedVuzeFileName( path )){ path = VuzeFileHandler.getVuzeFileName( path ); } try{ VuzeFile vf = device.getVuzeFile(); vf.write( new File( path )); }catch( Throwable e ){ Debug.out( e ); } } } });
@Override public void runSupport() { FileDialog dialog = new FileDialog( Utils.findAnyShell(), SWT.SYSTEM_MODAL | SWT.SAVE ); dialog.setFilterPath( TorrentOpener.getFilterPathData() ); dialog.setText(MessageText.getString("tag.export.select.template.file")); dialog.setFilterExtensions(VuzeFileHandler.getVuzeFileFilterExtensions()); dialog.setFilterNames(VuzeFileHandler.getVuzeFileFilterExtensions()); String path = TorrentOpener.setFilterPathData( dialog.open()); if ( path != null ){ if ( !VuzeFileHandler.isAcceptedVuzeFileName( path )){ path = VuzeFileHandler.getVuzeFileName( path ); } try{ VuzeFile vf = TagManagerFactory.getTagManager().exportTags( tags ); vf.write( new File( path )); }catch( Throwable e ){ Debug.out( e ); } } } });