code: private static String convert(String pkg) {
  
      pkg = pkg.trim();
      if (pkg.endsWith("*")) {
        pkg = pkg.substring(0, pkg.length() - 1);
      }
      if (pkg.endsWith(".query")) {
        // always work with entity bean packages so trim
        pkg = pkg.substring(0, pkg.length() - 6);
      }
      pkg = pkg.replace('.', '/');
      return pkg.endsWith("/") ? pkg : pkg + "/";
    }
docs: Concert package to slash notation taking into account trailing wildcard.