private static void GetAuxZipAliases(ZipFile file, LocalPackage pack) {
   ZipEntry ze;
   Enumeration<? extends ZipEntry> entries = file.entries();
   while (entries.hasMoreElements()) {
     ze = entries.nextElement();
     if (ze.getName().endsWith(".ms")) {
       if (ze.getName().equals("auto_include.ms")) {
         pack.addAutoInclude(new File(file.getName() + File.separator + ze.getName()));
       } else {
         try {
           pack.appendMS(
               Installer.parseISToString(file.getInputStream(ze)),
               new File(file.getName() + File.separator + ze.getName()));
         } catch (IOException ex) {
           Logger.getLogger(AliasCore.class.getName()).log(Level.SEVERE, null, ex);
         }
       }
     } else if (ze.getName().endsWith(".msa")) {
       try {
         pack.appendMSA(
             Installer.parseISToString(file.getInputStream(ze)),
             new File(file.getName() + File.separator + ze.getName()));
       } catch (IOException ex) {
         Logger.getLogger(AliasCore.class.getName()).log(Level.SEVERE, null, ex);
       }
     }
   }
 }
 /**
  * Saves any the settings (security or others) that the user may have changed. Normally called by
  * the scheduler after the last running MIDlet in the suite is destoryed. However it could be
  * called during a suspend of the VM so that persisent settings of the suite can be perserved or
  * by the graphical manager application settings MIDlet.
  */
 public void saveSettings() {
   try {
     Installer.saveSuiteSettings(
         classSecurityToken, storageRoot, (byte) pushInterruptSetting, permissions, trusted);
   } catch (IOException e) {
     // ignore
   }
 }
Beispiel #3
0
  public static void main(String[] args) throws Exception {
    String repo = "http://osgi.nuxeo.org/p2/ecr/current/repository";
    String profile = null;
    File installDir = null;
    String opt = null;
    for (int i = 0; i < args.length; i++) {
      String arg = args[i];
      if (opt != null) {
        if ("-r".equals(opt)) {
          repo = arg;
        } else if ("-p".equals(opt)) {
          profile = arg;
        } else {
          usage("Unknown option " + opt);
        }
        opt = null;
      } else if (arg.startsWith("-")) {
        opt = arg;
      } else {
        if (installDir != null) {
          usage("too much arguments");
        }
        installDir = new File(arg);
      }
    }
    if (installDir == null) {
      installDir = new File(".");
    }
    if (profile == null) {
      profile = "default";
    }

    String name = installDir.getName();
    boolean zipIt = name.endsWith(".zip");
    if (zipIt) {
      installDir = new File(installDir.getParentFile(), name.substring(0, name.length() - 4));
    }

    Installer installer = new Installer(installDir, repo);
    installer.install(profile, zipIt);
  }
 public static void install(String[] args) {
   if ((args.length >= 2) && ("-mediadir".equals(args[0]))) {
     // mediadir option given
     MultiVolumeInstaller.setMediadirectory(args[1]);
     if (args.length > 2) {
       // cut out this option
       String[] newargs = new String[args.length - 2];
       System.arraycopy(args, 2, newargs, 0, args.length - 2);
       args = newargs;
     } else {
       // put in an empty string array
       args = new String[0];
     }
   }
   // just call the izpack installer
   Installer.main(args);
 }