Package help
Class HelpBuildUtils
java.lang.Object
help.HelpBuildUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanupHelpFileLinks(Path helpFile) static PathcreateReferencePath(URI fileURI) static voidstatic URLfindApplicationUrl(String relativePath) Searches the application classpath (for a module file) and directory structure (for a release file), depending on whether in release mode or development mode, to find the URL for the given relative path.static ResourceFilefindModuleFile(String relativePath) Finds the actual module file for the given relative path when in development mode.static PathReturns a path object using the given source file path as the source of the given relative path.static PathgetHelpTopicDir(Path file) Returns a file object that is the help topic directory for the given file.static PathgetRoot(Collection<Path> roots, Path file) static IconProvidergetRuntimeIcon(String ref) static Pathstatic booleanReturns true if the given String represents a remote resourcestatic booleanReturns true if the given URI represents a remote resourcestatic booleanReturns true if the given Path represents a remote resourcestatic ImageLocationlocateImageReference(Path sourceFile, String ref) Turn an HTML IMG reference into a location object that has resolved path info.static PathlocateReference(Path sourceFile, String ref) Turn an HTML HREF reference into an absolute path.static Pathrelativize(Path parent, Path child) static Pathstatic PathtoDefaultFS(Path path) static Pathstatic HelpModuleLocationtoLocation(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
-
findModuleFile
Finds the actual module file for the given relative path when in development mode. For example, given:help/shared/DefaultStyle.cssThis method will find:{repo}/Ghidra/Framework/Help/src/main/resources/help/shared/DefaultStyle.css- Parameters:
relativePath- the path- Returns:
- the file
-
findApplicationUrl
Searches the application classpath (for a module file) and directory structure (for a release file), depending on whether in release mode or development mode, to find the URL for the given relative path.- Parameters:
relativePath- the path- Returns:
- the URL or null if not found
-
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