From d5822b3700c7af5ed429a72e1c381bae6d451674 Mon Sep 17 00:00:00 2001 From: 4pr0n Date: Sun, 20 Apr 2014 17:35:17 -0700 Subject: [PATCH] 1.0.22 - Fixing bug where nothing worked #20 Adding the /rippers/video subdirectory package caused the auto-class-finder to try to initialize a class that did not exist (dir name instead of class name). --- pom.xml | 2 +- src/main/java/com/rarchives/ripme/ui/UpdateUtils.java | 2 +- src/main/java/com/rarchives/ripme/utils/Utils.java | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index e5ff6d72..8217c3df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rarchives.ripme ripme jar - 1.0.21 + 1.0.22 ripme http://rip.rarchives.com diff --git a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java index caefb2bc..3e790cee 100644 --- a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java +++ b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java @@ -19,7 +19,7 @@ import org.jsoup.nodes.Document; public class UpdateUtils { private static final Logger logger = Logger.getLogger(UpdateUtils.class); - private static final String DEFAULT_VERSION = "1.0.21"; + private static final String DEFAULT_VERSION = "1.0.22"; private static final String updateJsonURL = "http://rarchives.com/ripme.json"; private static final String updateJarURL = "http://rarchives.com/ripme.jar"; private static final String mainFileName = "ripme.jar"; diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 2500984a..3c514846 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -199,23 +199,25 @@ public class Utils { } } else { + // Load from JAR try { - logger.debug("fullPath = " + fullPath); String jarPath = fullPath .replaceFirst("[.]jar[!].*", ".jar") .replaceFirst("file:", "") .replaceAll("%20", " "); - logger.debug("jarPath = " + jarPath); JarFile jarFile = new JarFile(jarPath); Enumeration entries = jarFile.entries(); while(entries.hasMoreElements()) { - String entryName = entries.nextElement().getName(); + JarEntry nextElement = entries.nextElement(); + String entryName = nextElement.getName(); if(entryName.startsWith(relPath) - && entryName.length() > (relPath.length() + "/".length())) { + && entryName.length() > (relPath.length() + "/".length()) + && !nextElement.isDirectory()) { String className = entryName.replace('/', '.').replace('\\', '.').replace(".class", ""); try { classes.add(Class.forName(className)); } catch (ClassNotFoundException e) { + logger.error("ClassNotFoundException loading " + className); throw new RuntimeException("ClassNotFoundException loading " + className); } }