コード例 #1
0
 /** Reads uids from 'uids' file during conversion of midlets from old java to OMJ. */
 private void readUidsFromFile(InstallBall aBall) {
   if (!aBall.iConversionInstallation) {
     return;
   }
   String uidsFilename = aBall.iConversionRoot + "uids";
   if (FileUtils.exists(uidsFilename)) {
     Log.log("Reading uids file: " + uidsFilename);
     Vector v = new Vector();
     InputStream is = null;
     try {
       is = FileUtils.getInputStream(uidsFilename);
       while (is.available() > 0) {
         v.addElement(readUid(is));
       }
     } catch (IOException ioe) {
       InstallerException.internalError("Error while reading uids file: " + uidsFilename, ioe);
     } finally {
       if (is != null) {
         try {
           is.close();
           is = null;
         } catch (IOException ioe) {
           Log.logWarning("Closing InputStream failed", ioe);
         }
       }
     }
     iUidsFromFile = new Uid[v.size()];
     v.copyInto(iUidsFromFile);
     for (int i = 0; i < iUidsFromFile.length; i++) {
       Log.log("Read uid[" + i + "]: " + iUidsFromFile[i]);
     }
   } else {
     InstallerException.internalError("No uids file: " + uidsFilename);
   }
 }
コード例 #2
0
 /** Updates root, jad and jar paths to suite info object. */
 private void updateSuitePaths(InstallBall aBall) {
   aBall.iSuite.setRootDir(
       FileUtils.getAppsRoot() + FileUtils.getAppRootPath(aBall.iSuite.getUid()));
   if (aBall.iJadFilename != null) {
     if (aBall.iPreinstallation) {
       // In preinstallation case use file without copying it to
       // suite root dir.
       aBall.iSuite.setJadPath(aBall.iJadFilename);
     } else {
       // Set jar path to point under suite root dir.
       aBall.iSuite.setJadPath(aBall.iSuite.getRootDir() + FileUtils.getName(aBall.iJadFilename));
     }
   }
   if (aBall.iJarFilename != null) {
     if (aBall.iPreinstallation) {
       // In preinstallation case use file without copying it to
       // suite root dir.
       aBall.iSuite.setJarPath(aBall.iJarFilename);
     } else {
       // Set jar path to point under suite root dir.
       aBall.iSuite.setJarPath(aBall.iSuite.getRootDir() + FileUtils.getName(aBall.iJarFilename));
     }
   }
 }