code: public static File classToRelativePackagePath(Class<?> clazz) {
  	if (File.separator.equals("/")) {
  	    return new File(clazz.getName().replaceAll("\\.", File.separator)
  		    + ".java");
  	} else {
  	    return new File(clazz.getName().replaceAll("\\.",
  		    File.separator + File.separator)
  		    + ".java");
  	}
      }
docs: This method converts a Class into a File which contains the package path.
  This is used to access Jar contents or the content of source directories
  to find source or class files.
  
  @param clazz
  is the class for which the source file is to be found.
  @return A {@link File} object is returned containing the relative path of
  the file starting on package root level.