protected VuzeFile exportVuzeFile( DeviceImpl device ) throws IOException { VuzeFile vf = VuzeFileHandler.getSingleton().create(); Map map = new HashMap(); Map device_map = new HashMap(); map.put( "device", device_map ); device.exportToBEncodedMap( device_map, true ); vf.addComponent( VuzeFileComponent.COMP_TYPE_DEVICE, map ); return( vf ); }
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(); } } }
VuzeFile vf = VuzeFileHandler.getSingleton().create();
VuzeFile vf = VuzeFileHandler.getSingleton().create();
VuzeFile vf = VuzeFileHandler.getSingleton().create();
public VuzeFile exportToVuzeFile( boolean generic ) throws IOException { VuzeFile vf = VuzeFileHandler.getSingleton().create(); vf.addComponent( VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE, exportToBencodedMap( generic )); return( vf ); }
List<Tag> tags) VuzeFile vf = VuzeFileHandler.getSingleton().create();
@Override public void exportToVuzeFile( File target ) throws IOException { VuzeFile vf = VuzeFileHandler.getSingleton().create(); vf.addComponent( VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE, exportToBencodedMap()); vf.write( target ); }
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 )); } }
VuzeFile target = vfh.create();
manager.subscribeToSubscription( arg ); input_stream = new ByteArrayInputStream( VuzeFileHandler.getSingleton().create().exportToBytes());
VuzeFile vf = VuzeFileHandler.getSingleton().create();
return( new ByteArrayInputStream( VuzeFileHandler.getSingleton().create().exportToBytes() ));
@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 )); } }