Class PluginInstallerSupport


  • public final class PluginInstallerSupport
    extends Object
    Support for copying files during plugin manipulation.
    • Field Detail

      • LOG

        @Nonnull
        private static final org.slf4j.Logger LOG
        Class logger.
    • Constructor Detail

      • PluginInstallerSupport

        private PluginInstallerSupport()
        Constructor.
    • Method Detail

      • deleteTree

        public static void deleteTree​(@Nullable
                                      Path directory)
        Delete a directory tree.
        Parameters:
        directory - what to delete
      • detectDuplicates

        public static boolean detectDuplicates​(Path from,
                                               Path to)
                                        throws org.apache.tools.ant.BuildException
        Traverse "from" looking to see if any of the files are already in "to".
        Parameters:
        from - source directory
        to - target directory
        Returns:
        true if there was a match
        Throws:
        org.apache.tools.ant.BuildException - if anything threw and IOException
      • copyWithLogging

        public static void copyWithLogging​(Path from,
                                           Path to,
                                           @Live
                                           List<Path> pathsCopied)
                                    throws org.apache.tools.ant.BuildException
        Copy a directory tree and keep a log of what has changed.
        Parameters:
        from - source directory
        to - target directory
        pathsCopied - the list of files copied up (including if there was a failure)
        Throws:
        org.apache.tools.ant.BuildException - from the copy
      • renameToTree

        public static void renameToTree​(@Nonnull
                                        Path fromBase,
                                        @Nonnull
                                        Path toBase,
                                        @Nonnull
                                        List<Path> fromFiles,
                                        @Nonnull @Live
                                        List<Pair<Path,​Path>> renames)
                                 throws IOException
        Rename Files into the provided tree.
        Parameters:
        fromBase - The root directory of the from files
        toBase - The root directory to rename to
        fromFiles - The list of files (inside fromBase) to rename
        renames - All the work as it is done
        Throws:
        IOException - If any of the file operations fail