/** * Returns the absolute path that is denoted by the given <code>path</code> * relatively to the directory that correspond to the given package name. If * the given path is not a relative path (see {@link #isRelative(String)}), * this method returns the given <code>path</code>. * * @param packageName a package name * @param path a valid path (see {@link #isValid(String)}). * @return the absolute path that is denoted by the given <code>path</code> * relatively to the directory that correspond to the given package * name. * @see #packageNameToDirName(String) * @see #toAbsolute(String, String) */ public static String packageNameToAbsolute(final String packageName, final String path) { return toAbsolute(packageNameToDirName(packageName), path); }
/** * Returns the absolute path that is denoted by the given <code>path</code> * relatively to the directory that correspond to the package name of the * given fully-qualified name. If the given path is not a relative path (see * {@link #isRelative(String)}), this method returns the given * <code>path</code>. * * @param fullyQualifiedName a fully qualified name * @param path a valid path (see {@link #isValid(String)}). * @return the absolute path that is denoted by the given <code>path</code> * relatively to the directory that correspond to the package name of * the given fully-qualified name. * @see #fullyQualifiedNameToDirName(String) * @see #toAbsolute(String, String) */ public static String fullyQualifiedNameToAbsolute( final String fullyQualifiedName, final String path) { return toAbsolute(fullyQualifiedNameToDirName(fullyQualifiedName), path); }
.substring(3); return toAbsolute(dirName.substring(0, lastSlash - 1), "./" + path.substring(3));