private static void loadPlatformZipPropertiesFromFile() {
   File installLocation = getInstallLocation();
   if (installLocation != null) {
     // parent will be "eclipse" and the parent's parent will be "eclipse-testing"
     File parent = installLocation.getParentFile();
     if (parent != null) {
       parent = parent.getParentFile();
       if (parent != null) {
         File propertiesFile = new File(parent, "equinoxp2tests.properties");
         if (!propertiesFile.exists()) return;
         archiveAndRepositoryProperties = new Properties();
         try {
           InputStream is = null;
           try {
             is = new BufferedInputStream(new FileInputStream(propertiesFile));
             archiveAndRepositoryProperties.load(is);
           } finally {
             is.close();
           }
         } catch (IOException e) {
           return;
         }
       }
     }
   }
 }
Beispiel #2
0
 /** Load any progress information for the import so far. */
 void restore() throws IOException {
   try {
     File dir = getStorageDirectory();
     File index = new File(dir, FILE_INDEX);
     props.load(new FileInputStream(index));
   } catch (FileNotFoundException e) {
     // ok if file doesn't exist yet
   }
 }
 public static Properties getConfigIniProperties() {
   File iniFile =
       new File(TargetPlatform.getLocation(), "configuration/config.ini"); // $NON-NLS-1$
   if (!iniFile.exists()) return null;
   Properties pini = new Properties();
   FileInputStream fis = null;
   try {
     fis = new FileInputStream(iniFile);
     pini.load(fis);
     fis.close();
     return pini;
   } catch (IOException e) {
     MDECore.logException(e);
   } finally {
     try {
       if (fis != null) fis.close();
     } catch (IOException e) {
       MDECore.logException(e);
     }
   }
   return null;
 }