1 6 7 package com.memoire.vainstall; 8 9 import java.io.File ; 10 import java.io.IOException ; 11 12 16 17 public class VAInstall { 18 19 public static void main(String [] args) { 20 21 String javaVersion = System.getProperty("java.version"); 22 23 if (javaVersion.indexOf("1.4.") != -1) { 24 26 if (args != null && args.length == 1 && args[0].equals("-gui") == true) { 27 try { 28 Object controller = Class.forName("com.memoire.vainstall.builder.VAIBuilderController").newInstance(); 29 } catch (Exception exc) { 30 exc.printStackTrace(); 31 } 32 return; 33 } 34 } 35 36 37 if ( args.length < 1 ) { 38 usage(); 39 System.exit(1); 40 } 41 42 File propFile = new File (args[0]); 43 if ( (propFile.exists()) && (propFile.canRead()) ) { 44 try { 45 VAProperties.PROPERTIES.loadProperties(propFile); 46 } catch( IOException exc ) { 47 exc.printStackTrace(); 48 } 49 } else { 50 if (args[0].equals("-gui") == true) { 51 System.err.println("'-gui' only supported on Java 1.4"); 52 } else { 53 System.err.println(args[0]+" can not be read."); 54 } 55 System.exit(1); 56 } 57 58 VAArchiver archiver=new VAArchiver(); 59 archiver.start(); 60 61 System.exit(0); 62 63 } 64 65 public static void usage() { 66 System.out.println("Usage: java "+new VAInstall().getClass().getName()+" <.vai file>"); 67 } 68 69 } 70 | Popular Tags |