/**
   * Gets properites from a symbolically named installed package. The properties are the attributes
   * in the application descriptor and JAR Manifest.
   */
  private void getPropertiesFromStorage() {
    RandomAccessStream myStorage;
    int size;
    byte[] buffer;
    InputStream is;
    DataInputStream dis;
    String jadEncoding = null;

    myStorage = new RandomAccessStream(classSecurityToken);

    // Get the JAD encoding, if the server provided one
    try {
      myStorage.connect(storageRoot + Installer.JAD_ENCODING_FILENAME, Connector.READ);
      try {
        // convert the JAD encoding to UTF8 and write it to storage
        dis = myStorage.openDataInputStream();
        try {
          jadEncoding = dis.readUTF();
        } finally {
          dis.close();
        }
      } finally {
        myStorage.disconnect();
      }
    } catch (IOException e) {
      // servers can choose the default encoding by not providing one
    }

    // Load .jad file
    bufferedJadProps = new JadProperties();
    try {
      myStorage.connect(storageRoot + Installer.JAD_FILENAME, Connector.READ);
      try {
        size = myStorage.getSizeOf();
        buffer = new byte[size];
        dis = myStorage.openDataInputStream();
        try {
          dis.readFully(buffer);
          is = new ByteArrayInputStream(buffer);

          bufferedJadProps.load(is, jadEncoding);

          buffer = null;
          is = null;
        } finally {
          dis.close();
        }
      } finally {
        myStorage.disconnect();
      }
    } catch (IOException e) {
      // Jar only install
    }

    try {
      // Get Manifest file so we can buffer it
      myStorage.connect(storageRoot + Installer.MANIFEST_FILENAME, Connector.READ);
      try {
        size = myStorage.getSizeOf();
        buffer = new byte[size];
        dis = myStorage.openDataInputStream();
        try {
          dis.readFully(buffer);
          is = new ByteArrayInputStream(buffer);

          bufferedJarProps = new ManifestProperties();
          bufferedJarProps.load(is);

          buffer = null;
          is = null;
        } finally {
          dis.close();
        }
      } finally {
        myStorage.disconnect();
      }
    } catch (IOException e) {
      // ignore
    }
  }