Ignore:
Timestamp:
06/11/08 09:22:56 (16 years ago)
Author:
ra33
Message:

Fixed bug preventing it from working in windows... and added comment to stop that happening again.

Added right click and drag to a line...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Actions.java

    r86 r102  
    7272                // Get a File object for the package
    7373                File directory = null;
    74                 String path = pckgname.replace('.', File.separatorChar);
     74                // Must be a forward slash for loading resources
     75                String path = pckgname.replace('.', '/');
     76                //System.out.println("Get classes: " + path);
    7577                try {
    7678                        ClassLoader cld = Thread.currentThread().getContextClassLoader();
     
    103105                                        + ") does not appear to be a valid package");
    104106                }
    105 
     107                //System.out.println("Path:" + directory.getPath());
    106108                int splitPoint = directory.getPath().indexOf('!');
    107109                if (splitPoint > 0) {
     
    116118                                        jarName = jarName.replace("%20", " ");
    117119                                }
    118 
     120                                //System.out.println("JarName:" + jarName);
    119121                                JarFile jarFile = new JarFile(jarName);
    120122
    121123                                Enumeration entries = jarFile.entries();
     124                                int classCount = 0;
    122125                                while (entries.hasMoreElements()) {
    123126                                        ZipEntry entry = (ZipEntry) entries.nextElement();
     
    126129                                                if (className.endsWith(".class")
    127130                                                                && !className.contains("$")) {
     131                                                        classCount++;
     132                                                        // The forward slash below is a forwards slash for
     133                                                        // both windows and linux
    128134                                                        classes.add(Class.forName(className.substring(0,
    129135                                                                        className.length() - 6).replace('/', '.')));
     
    132138                                }
    133139                                jarFile.close();
     140                                //System.out.println("Loaded " + classCount + " classes from "
     141                                //              + pckgname);
    134142
    135143                        } catch (Exception e) {
     
    353361                        FrameGraphics.ErrorMessage("Incorrect parameters for " + mname);
    354362                } else {
    355                         assert(false);
     363                        assert (false);
    356364                        FrameGraphics.ErrorMessage(mname + " action not found");
    357365                }
Note: See TracChangeset for help on using the changeset viewer.