Class PluginUtil


  • public final class PluginUtil
    extends Object
    • Method Detail

      • shouldSync

        public static boolean shouldSync​(Path projectRoot,
                                         PluginCatalog catalog)
      • getType

        public static PluginType getType​(String location)
        Get the PluginType that corresponds the the specified location.
        Parameters:
        the - location
        Returns:
        the PluginType that corresponds to the location.
      • getType

        public static PluginType getType​(Optional<io.quarkus.maven.dependency.GACTV> gactv,
                                         Optional<URL> url,
                                         Optional<Path> path)
        Get the PluginType that corresponds the the specified locations.
        Parameters:
        url - the url
        path - the path
        gactv - the gactv
        Returns:
        the PluginType that corresponds to the location.
      • shouldRemove

        public static boolean shouldRemove​(Plugin p)
        Check if the plugin can be found. The method is used to determined the plugin can be located.
        Returns:
        true if path is not null and points to an existing file.
      • checkUrl

        public static Optional<URL> checkUrl​(String location)
        Chekcs if specified String is a valid .
        Parameters:
        location - The string to check
        Returns:
        The URL wrapped in Optional if valid, empty otherwise.
      • checkGACTV

        public static Optional<io.quarkus.maven.dependency.GACTV> checkGACTV​(String location)
        Chekcs if specified String is a valid .
        Parameters:
        location - The string to check
        Returns:
        The URL wrapped in Optional if valid, empty otherwise.
      • checkGACTV

        public static Optional<io.quarkus.maven.dependency.GACTV> checkGACTV​(Optional<String> location)
      • checkPath

        public static Optional<Path> checkPath​(String location)
        Chekcs if specified String is a valid path.
        Parameters:
        location - The string to check
        Returns:
        The Path wrapped in Optional if valid, empty otherwise.
      • checkRemoteCatalog

        public static Optional<String> checkRemoteCatalog​(String location)
        Chekcs if specified String contains a valid remote catalog
        Parameters:
        location - The string to check
        Returns:
        The catalog wrapped in Optional if valid, empty otherwise.
      • isRemoteLocation

        public static boolean isRemoteLocation​(String location)
        Checks if location is remote.
        Parameters:
        location - the specifiied location.
        Returns:
        true if location is url or gactv
      • isLocalFile

        public static boolean isLocalFile​(String location)
        Checks if location is a file that does exists locally.
        Parameters:
        location - the specifiied location.
        Returns:
        true if location is url or gactv
      • isProjectFile

        public static boolean isProjectFile​(Path projectRoot,
                                            String location)
        Checks if location is a file that does exists under the project root.
        Parameters:
        projectRoot - the root of the project.
        location - the specifiied location.
        Returns:
        true if location is url or gactv