FileDocCategorySizeDatePackage
XML.javaAPI DocAzureus 3.0.3.41559Mon Dec 18 19:04:16 GMT 2006org.gudy.azureus2.ui.console.commands

XML

public class XML extends IConsoleCommand
author
tobi

Fields Summary
Constructors Summary
public XML()

		super( new String[] { "xml"} );
	
Methods Summary
public voidexecute(java.lang.String commandName, org.gudy.azureus2.ui.console.ConsoleInput ci, java.util.List args)

		StatsWriterStreamer sws = StatsWriterFactory.createStreamer(ci.getCore());
		String file = null;
		if ((args != null) && (!args.isEmpty()))
				file = (String) args.get(0);
		if (file == null) {
			try {
				ci.out.println("> -----");
				sws.write(ci.out);
				ci.out.println("> -----");
			} catch (Exception e) {
				ci.out.println("> Exception while trying to output xml stats:" + e.getMessage());
			}
		} else {
			try {
				FileOutputStream os = new FileOutputStream(file);

				try {

					sws.write(os);

				} finally {

					os.close();
				}
				ci.out.println("> XML stats successfully written to " + file);
			} catch (Exception e) {
				ci.out.println("> Exception while trying to write xml stats:" + e.getMessage());
			}
		}
	
public java.lang.StringgetCommandDescriptions()

		return("xml [<file>]\t\t\t\tOutput stats in xml format (to <file> if given)");