1 9 package org.jrobin.core.jrrd; 10 11 import java.io.IOException ; 12 13 19 public class Main { 20 21 public Main(String rrdFile) { 22 23 RRDatabase rrd = null; 24 DataChunk chunk = null; 25 26 try { 27 rrd = new RRDatabase(rrdFile); 28 chunk = rrd.getData(ConsolidationFunctionType.AVERAGE); 29 } catch (Exception e) { 30 e.printStackTrace(); 31 32 return; 33 } 34 35 rrd.toXml(System.out); rrd.printInfo(System.out); System.out.println(rrd); System.out.println(chunk); 40 try { 41 rrd.close(); 42 } catch (IOException e) { 43 e.printStackTrace(); 44 } 45 } 46 47 static void usage(int status) { 48 System.err.println("Usage: " + Main.class.getName() + " rrdfile"); 49 System.exit(status); 50 } 51 52 public static void main(String [] args) { 53 if (args.length != 1) { 54 usage(1); 55 } 56 new Main(args[0]); 57 } 58 } 59 | Popular Tags |