protected File getVuzeFile( SubscriptionImpl subs ) throws IOException { File dir = getSubsDir(); return( new File( dir, VuzeFileHandler.getVuzeFileName( ByteFormatter.encodeString( subs.getShortID())))); }
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 )); } }
File output_file = new File( VuzeFileHandler.getVuzeFileName( args[0] ));
path = VuzeFileHandler.getVuzeFileName( path );
String name = VuzeFileHandler.getVuzeFileName( filename );
interface subsLookupListener extends SubscriptionLookupListener { public boolean isCancelled(); }
@Override public void runSupport() { FileDialog dialog = new FileDialog( shell, SWT.SYSTEM_MODAL | SWT.SAVE ); dialog.setFilterPath( TorrentOpener.getFilterPathData() ); dialog.setText(MessageText.getString("metasearch.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{ MetaSearchManagerFactory.getSingleton().getMetaSearch().exportEngines( 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("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 ); } } } });