| java.lang.Object com.sun.tools.doclets.internal.toolkit.util.DirectoryManager
DirectoryManager | public class DirectoryManager (Code) | | Handle the directory creations and the path string generations.
All static - never instaniated.
This code is not part of an API.
It is implementation that is subject to change.
Do not use it as an API
since: 1.2 author: Atul M Dambalkar |
Field Summary | |
final public static String | URL_FILE_SEPERATOR The file separator string, "/", used in the formation of the URL path. |
Method Summary | |
public static void | createDirectory(Configuration configuration, String path) Given a path string create all the directories in the path. | public static String | createPathString(PackageDoc pd) Given a PackageDoc, return its URL path string. | public static String | createPathString(ClassDoc cd) Given a ClassDoc, return its URL path string. | public static String | getDirectoryPath(PackageDoc pd) Given a PackageDoc, return the corresponding directory name
with the platform-dependent file separator between subdirectory names.
For example, if name of the package is "java.lang" , then it
returns "java/lang" on Unix and "java\lang" on Windows.
If name of the package contains no dot, then the value
will be returned unchanged. | public static String | getDirectoryPath(String packageName) Given a package name, return the corresponding directory name
with the platform-dependent file separator between subdirectory names.
For example, if name of the package is "java.lang" , then it
returns "java/lang" on Unix and "java\lang" on Windows.
If name of the package contains no dot, then the value
will be returned unchanged. | public static String | getPath(String name) Given a package name (a string), return the path string,
with the URL separator "/" separating the subdirectory names.
If name of the package contains no dot, then the value
will be returned unchanged. | public static String | getPathNoTrailingSlash(String path) Given a relative or absolute path that might be empty,
convert it to a path that does not end with a
URL separator "/". | public static String | getPathToClass(ClassDoc cd) Given a class name return the full path to the class file. | public static String | getPathToPackage(PackageDoc pd, String filename) Given a package name and a file name, return the full path to that file. | public static String | getRelativePath(String from, String to) Given two package names as strings, return the relative path
from the package directory corresponding to the first string
to the package directory corresponding to the second string,
with the URL file separator "/" separating subdirectory names. | public static String | getRelativePath(PackageDoc from) Given a package name as a string, return relative path string
from the corresponding package directory to the root of
the documentation, using the URL separator "/" between
subdirectory names. | public static String | getRelativePath(String from) Given a package name as a string, return relative path string
from the corresponding package directory to the root of
the documentation, using the URL separator "/" between
subdirectory names. |
URL_FILE_SEPERATOR | final public static String URL_FILE_SEPERATOR(Code) | | The file separator string, "/", used in the formation of the URL path.
|
createDirectory | public static void createDirectory(Configuration configuration, String path)(Code) | | Given a path string create all the directories in the path. For example,
if the path string is "java/applet", the method will create directory
"java" and then "java/applet" if they don't exist. The file separator
string "/" is platform dependent system property.
Parameters: path - Directory path string. |
getDirectoryPath | public static String getDirectoryPath(PackageDoc pd)(Code) | | Given a PackageDoc, return the corresponding directory name
with the platform-dependent file separator between subdirectory names.
For example, if name of the package is "java.lang" , then it
returns "java/lang" on Unix and "java\lang" on Windows.
If name of the package contains no dot, then the value
will be returned unchanged. Because package names cannot
end in a dot, the return value will never end with a slash.
Also see getPath for the URL separator version of this method
that takes a string instead of a PackageDoc.
Parameters: pd - the PackageDoc the platform-dependent directory path for the package |
getDirectoryPath | public static String getDirectoryPath(String packageName)(Code) | | Given a package name, return the corresponding directory name
with the platform-dependent file separator between subdirectory names.
For example, if name of the package is "java.lang" , then it
returns "java/lang" on Unix and "java\lang" on Windows.
If name of the package contains no dot, then the value
will be returned unchanged. Because package names cannot
end in a dot, the return value will never end with a slash.
Also see getPath for the URL separator version of this method
that takes a string instead of a PackageDoc.
Parameters: packageName - the name of the package the platform-dependent directory path for the package |
getPath | public static String getPath(String name)(Code) | | Given a package name (a string), return the path string,
with the URL separator "/" separating the subdirectory names.
If name of the package contains no dot, then the value
will be returned unchanged. Because package names cannot
end in a dot, the return value will never end with a slash.
For example if the string is "com.sun.javadoc" then the URL
path string will be "com/sun/javadoc".
Parameters: name - the package name as a String the String URL path |
getPathNoTrailingSlash | public static String getPathNoTrailingSlash(String path)(Code) | | Given a relative or absolute path that might be empty,
convert it to a path that does not end with a
URL separator "/". Used for converting
HtmlStandardWriter.relativepath when replacing
.
Parameters: path - the path to convert. An empty path representsthe current directory. |
getPathToClass | public static String getPathToClass(ClassDoc cd)(Code) | | Given a class name return the full path to the class file.
For example, if ClassDoc passed is for "java.lang.Object" then the
string returned is "java/lang/Object.html".
Parameters: cd - ClassDoc. |
getPathToPackage | public static String getPathToPackage(PackageDoc pd, String filename)(Code) | | Given a package name and a file name, return the full path to that file.
For example, if PackageDoc passed is for "java.lang" and the filename
passed is "package-summary.html", then the string returned is
"java/lang/package-summary.html".
Parameters: pd - PackageDoc. Parameters: filename - File name to be appended to the path of the package. |
getRelativePath | public static String getRelativePath(String from, String to)(Code) | | Given two package names as strings, return the relative path
from the package directory corresponding to the first string
to the package directory corresponding to the second string,
with the URL file separator "/" separating subdirectory names.
For example, if the parameter "from" is "java.lang"
and parameter "to" is "java.applet", return string
"../../java/applet".
Parameters: from - the package name from which path is calculated Parameters: to - the package name to which path is calculated relative path between "from" and "to" with URLseparators See Also: DirectoryManager.getRelativePath(String) See Also: DirectoryManager.getPath(String) |
getRelativePath | public static String getRelativePath(PackageDoc from)(Code) | | Given a package name as a string, return relative path string
from the corresponding package directory to the root of
the documentation, using the URL separator "/" between
subdirectory names.
For example, if the string "from" is "java.lang",
return "../../"
Parameters: from - the package String relative path from "from". See Also: DirectoryManager.getRelativePath(String,String) |
getRelativePath | public static String getRelativePath(String from)(Code) | | Given a package name as a string, return relative path string
from the corresponding package directory to the root of
the documentation, using the URL separator "/" between
subdirectory names.
For example, if the string "from" is "java.lang",
return "../../"
Parameters: from - the package name String relative path from "from". See Also: DirectoryManager.getRelativePath(String,String) |
|
|