code: protected String[] decomposePath (String root, String path)
      {
          // first strip off the root
          if (!path.startsWith(root)) {
              throw new RuntimeException("Can't bundle images outside the root directory " +
                                         "[root=" + root + ", path=" + path + "].");
          }
          path = path.substring(root.length());
  
          // strip off any preceding file separator
          if (path.startsWith(File.separator)) {
              path = path.substring(1);
          }
  
          // now strip off the file extension
          if (!path.endsWith(BundleUtil.IMAGE_EXTENSION)) {
              throw new RuntimeException("Can't bundle malformed image file [path=" + path + "].");
          }
          path = path.substring(0, path.length() - BundleUtil.IMAGE_EXTENSION.length());
  
          // now decompose the path; the component type and action must always be a single string but
          // the class can span multiple directories for easier component organization; thus
          // "male/head/goatee/standing" will be parsed as
          // [class=male/head, type=goatee, action=standing]
          String malmsg = "Can't decode malformed image path: '" + path + "'";
          String[] info = new String[3];
          int lsidx = path.lastIndexOf(File.separator);
          if (lsidx == -1) {
              throw new RuntimeException(malmsg);
          }
          info[2] = path.substring(lsidx+1);
          int slsidx = path.lastIndexOf(File.separator, lsidx-1);
          if (slsidx == -1) {
              throw new RuntimeException(malmsg);
          }
          info[1] = path.substring(slsidx+1, lsidx);
          info[0] = path.substring(0, slsidx);
          // we need to turn file separator characters (platform dependent) into jar path separator
          // characters (always forward slash)
          info[0].replace(File.separatorChar, '/');
          return info;
      }
docs: Decomposes the full path to a component image into a [class, name,
  action] triplet.