Class HotDeploymentWatchedFileBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem

public final class HotDeploymentWatchedFileBuildItem extends MultiBuildItem
Identifies a file from a reloadable module that, if modified, may result in a hot redeployment when in the dev mode.

A file may be identified with an location or a matching predicate. See HotDeploymentWatchedFileBuildItem.Builder.setLocation(String) and HotDeploymentWatchedFileBuildItem.Builder.setLocationPredicate(Predicate). The location may be:

  • a relative OS-agnostic file path where / is used as a separator; e.g. foo/bar.txt
  • an absolute OS-specific file path; e.g. /home/foo/bar.txt
  • a glob pattern as defined in FileSystem.getPathMatcher(String); e.g. *.sample

If multiple build items match the same file then the final value of restartNeeded is computed as a logical OR of all the isRestartNeeded() values.

  • Constructor Details

    • HotDeploymentWatchedFileBuildItem

      public HotDeploymentWatchedFileBuildItem(String location)
      Parameters:
      location -
      See Also:
    • HotDeploymentWatchedFileBuildItem

      public HotDeploymentWatchedFileBuildItem(String location, boolean restartNeeded)
      Parameters:
      location -
      restartNeeded -
      See Also:
  • Method Details

    • builder

    • getLocation

      public String getLocation()
      Returns:
      a location a file from a reloadable module
    • hasLocation

      public boolean hasLocation()
    • getLocationPredicate

      public Predicate<String> getLocationPredicate()
      Returns:
      a predicate used to match a file from a reloadable module
    • hasLocationPredicate

      public boolean hasLocationPredicate()
    • isRestartNeeded

      public boolean isRestartNeeded()
      Returns:
      true if a file change should result in an application restart, false otherwise