code: public static Object loadObject (ResourceBundle bundle, String path, boolean wipeOnFailure)
          throws IOException, ClassNotFoundException
      {
          InputStream bin = null;
          try {
              bin = bundle.getResource(path);
              if (bin == null) {
                  return null;
              }
              return new ObjectInputStream(bin).readObject();
  
          } catch (InvalidClassException ice) {
              log.warning("Aiya! Serialized object is hosed [bundle=" + bundle +
                          ", element=" + path + ", error=" + ice.getMessage() + "].");
              return null;
  
          } catch (IOException ioe) {
              log.warning("Error reading resource from bundle [bundle=" + bundle + ", path=" + path +
                          ", wiping?=" + wipeOnFailure + "].");
              if (wipeOnFailure) {
                  StreamUtil.close(bin);
                  bin = null;
                  if (bundle instanceof FileResourceBundle) {
                      ((FileResourceBundle)bundle).wipeBundle(false);
                  }
              }
              throw ioe;
  
          } finally {
              StreamUtil.close(bin);
          }
      }
docs: Attempts to load an object from the supplied resource bundle with the specified path.
  
  @param wipeOnFailure if there is an error reading the object from the bundle and this
  parameter is true, we will instruct the bundle to delete its underlying jar file before
  propagating the exception with the expectation that it will be redownloaded and repaired the
  next time the application is run.
  
  @return the unserialized object in question.
  
  @exception IOException thrown if an I/O error occurs while reading the object from the
  bundle.