Package help

# Class HelpBuildUtils

java.lang.Object
help.HelpBuildUtils

public class HelpBuildUtils extends Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `HelpBuildUtils.HelpFilesFilter`
  `static interface`
  `HelpBuildUtils.Stringizer<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static boolean`
  `debug`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `cleanupHelpFileLinks(Path helpFile)`
  `static Path`
  `createReferencePath(URI fileURI)`
  `static void`
  `debug(String text)`
  `static URL`
  `findApplicationUrl(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 ResourceFile`
  `findModuleFile(String relativePath)`
  Finds the actual module file for the given relative path when in development mode.
  `static Path`
  `getFile(Path srcFile, String relativePath)`
  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`
  `getSharedHelpDirectory()`
  `static boolean`
  `isRemote(String uriString)`
  Returns true if the given String represents a remote resource
  `static boolean`
  `isRemote(URI uri)`
  Returns true if the given URI represents a remote resource
  `static boolean`
  `isRemote(Path path)`
  Returns true if the given Path represents a remote resource
  `static 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`
  `relativeTo(Path targetFS, Path path)`
  `static Path`
  `relativeToWorkingDir(Path path)`
  `static Path`
  `relativize(Path parent, Path child)`
  `static Path`
  `relativizeWithHelpTopics(Path p)`
  `static HelpModuleLocation`
  `toLocation(File file)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### debug

    public static boolean debug

- ## Method Details

  - ### getSharedHelpDirectory

    public static Path getSharedHelpDirectory()

  - ### toLocation

    public static HelpModuleLocation toLocation(File file)

  - ### getRoot

    public static Path getRoot(Collection<Path> roots, Path file)

  - ### getHelpTopicDir

    public static Path getHelpTopicDir(Path file)
    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

    public static Path getFile(Path srcFile, String relativePath)
    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 path
      `relativePath` - the relative path
    Returns:
      a path or null if the resolved path is not a local file

  - ### relativizeWithHelpTopics

    public static Path relativizeWithHelpTopics(Path p)

  - ### relativize

    public static Path relativize(Path parent, Path child)

  - ### findModuleFile

    public static ResourceFile findModuleFile(String relativePath)
    Finds the actual module file for the given relative path when in development mode. For example, given:

                help/shared/DefaultStyle.css

    This method will find:

                {repo}/Ghidra/Framework/Help/src/main/resources/help/shared/DefaultStyle.css

    Parameters:
      `relativePath` - the path
    Returns:
      the file

  - ### findApplicationUrl

    public static URL findApplicationUrl(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.
    Parameters:
      `relativePath` - the path
    Returns:
      the URL or null if not found

  - ### cleanupHelpFileLinks

    public static void cleanupHelpFileLinks(Path helpFile) throws IOException
    Throws:
      `IOException`

  - ### debug

    public static void debug(String text)

  - ### relativeToWorkingDir

    public static Path relativeToWorkingDir(Path path)

  - ### relativeTo

    public static Path relativeTo(Path targetFS, Path path)

  - ### createReferencePath

    public static Path createReferencePath(URI fileURI)

  - ### isRemote

    public static boolean isRemote(String uriString)
    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

    public static boolean isRemote(Path path)
    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

    public static boolean isRemote(URI uri)
    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

    public static IconProvider getRuntimeIcon(String ref)

  - ### 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 reference
      `ref` - 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

    public static Path locateReference(Path sourceFile, String ref) throws URISyntaxException
    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 file
      `ref` - 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