src/main/java/org/jboss/util/Classes.java
public static String getPackageName(final String classname)
   {
      if (classname.length() == 0)
         throw new EmptyStringException();

      int index = classname.lastIndexOf(PACKAGE_SEPARATOR);
      if (index != -1)
         return classname.substring(0, index);
      return "";
   }
public static String getPackageName(final String classname)
   {
      if (classname.length() == 0)
         throw new EmptyStringException();

      int index = classname.lastIndexOf(PACKAGE_SEPARATOR);
      if (index != -1)
         return classname.substring(0, index);
      return "";
   }
Get the package name of the specified class.

@param classname  Class name.
@return           Package name or "" if the classname is in the
<i>default</i> package.

@throws EmptyStringException     Classname is an empty string.