Package help
Class HelpBuildUtils
java.lang.Object
help.HelpBuildUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
cleanupHelpFileLinks
(Path helpFile) static Path
createReferencePath
(URI fileURI) static void
static Path
Returns a path object using the given source file path as the source of the given relative path.static Path
getHelpTopicDir
(Path file) Returns a file object that is the help topic directory for the given file.static Path
getRoot
(Collection<Path> roots, Path file) static IconProvider
getRuntimeIcon
(String ref) static Path
static boolean
Returns true if the given String represents a remote resourcestatic boolean
Returns true if the given URI represents a remote resourcestatic boolean
Returns true if the given Path represents a remote resourcestatic ImageLocation
locateImageReference
(Path sourceFile, String ref) Turn an HTML IMG reference into a location object that has resolved path info.static Path
locateReference
(Path sourceFile, String ref) Turn an HTML HREF reference into an absolute path.static Path
relativize
(Path parent, Path child) static Path
static Path
toDefaultFS
(Path path) static Path
static HelpModuleLocation
toLocation
(File file)
-
Field Details
-
debug
public static boolean debug
-
-
Method Details
-
toLocation
-
getRoot
-
getHelpTopicDir
Returns a file object that is the help topic directory for the given file.This method is useful for finding the help topic directory when the given file doesn't live directly under a help topic.
- Parameters:
file
- the file for which to find a topic- Returns:
- the path to the help topic directory
-
getFile
Returns a path object using the given source file path as the source of the given relative path. The returned path represents a local file on the file system.- Parameters:
srcFile
- the source file pathrelativePath
- the relative path- Returns:
- a path or null if the resolved path is not a local file
-
relativizeWithHelpTopics
-
relativize
-
cleanupHelpFileLinks
- Throws:
IOException
-
debug
-
toDefaultFS
-
toFS
-
createReferencePath
-
isRemote
Returns true if the given String represents a remote resource- Parameters:
uriString
- the URI to test- Returns:
- true if the given String represents a remote resource
-
isRemote
Returns true if the given Path represents a remote resource- Parameters:
path
- the path- Returns:
- true if the given Path represents a remote resource
-
isRemote
Returns true if the given URI represents a remote resource- Parameters:
uri
- the URI- Returns:
- true if the given URI represents a remote resource
-
getRuntimeIcon
-
locateImageReference
public static ImageLocation locateImageReference(Path sourceFile, String ref) throws URISyntaxException Turn an HTML IMG reference into a location object that has resolved path info. This will locate files based upon relative references, specialized help system references (i.e., help/topics/...), and absolute URLs.- Parameters:
sourceFile
- the source file path of the image referenceref
- the reference text- Returns:
- an absolute path; null if the URI is remote
- Throws:
URISyntaxException
- if there is an exception creating a URL/URI for the image location
-
locateReference
Turn an HTML HREF reference into an absolute path. This will locate files based upon relative references, specialized help system references (i.e., help/topics/...), and absolute URLs.- Parameters:
sourceFile
- the reference's source fileref
- the reference text- Returns:
- an absolute path; null if the URI is remote
- Throws:
URISyntaxException
- if there is an exception creating a URL/URI for the image location