Package help

Class HelpBuildUtils

java.lang.Object
help.HelpBuildUtils

public class HelpBuildUtils extends Object
  • Field Details

    • debug

      public static boolean debug
  • Method Details

    • 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.
    • getFile

      public static Path getFile(Path srcFile, String relativePath)
    • relativizeWithHelpTopics

      public static Path relativizeWithHelpTopics(Path p)
    • relativize

      public static Path relativize(Path parent, Path child)
    • cleanupHelpFileLinks

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

      public static void debug(String text)
    • toDefaultFS

      public static Path toDefaultFS(Path path)
    • toFS

      public static Path toFS(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
    • 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
    • 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:
      ref - the reference text
      Returns:
      an absolute path; null if the URI is remote
      Throws:
      URISyntaxException