public static String packageToPath(String packageName){
  return packageName.replace('.',File.separatorChar);
}

public static String packageToPath ( String packageName ) { return packageName . replace ( '.' , File . separatorChar ) ; }
converts a package name to a path by replacing all ' . ' characters with the file . separatorchar character . is therefore platform independent .
