@@ -0,0 +1,3235 @@
+/*%0A * Copyright (c) 2006-2014 DMDirc Developers%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0A * SOFTWARE.%0A */%0A%0Apackage com.dmdirc.util.io;%0A%0Aimport java.io.IOException;%0Aimport java.net.URL;%0Aimport java.nio.file.CopyOption;%0Aimport java.nio.file.DirectoryStream;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.nio.file.StandardCopyOption;%0A%0A/**%0A * Utility class to deal with files.%0A */%0Apublic final class FileUtils %7B%0A%0A    private FileUtils() %7B%0A        // Shouldn't be instansiated.%0A    %7D%0A%0A    /**%0A     * Recursively copies the resources specified by the given URL to the destination folder.%0A     * Existing files will be replaced.%0A     *%0A     * @param source The resource to be copied (file or folder).%0A     * @param destination The destination folder to copy the resource to.%0A     * @throws IOException If the resource couldn't be copied.%0A     */%0A    public static void copyResources(final URL source, final Path destination) throws IOException %7B%0A        final Path sourcePath = Paths.get(source.toString());%0A%0A        copyRecursively(sourcePath, destination, StandardCopyOption.REPLACE_EXISTING);%0A    %7D%0A%0A    /**%0A     * Recursively copies one path to another. Once complete, a deep copy of the source file or%0A     * folder will be present in the destination directory.%0A     *%0A     * @param source The path that should be copied.%0A     * @param destination The directory to place copied files in.%0A     * @param options Options to use when copying.%0A     * @throws IOException If any files couldn't be copied.%0A     */%0A    public static void copyRecursively(final Path source, final Path destination,%0A            final CopyOption... options) throws IOException %7B%0A        final Path destinationPath = destination.resolve(source.getFileName());%0A%0A        if (Files.isDirectory(source)) %7B%0A            Files.createDirectories(destinationPath);%0A            try (DirectoryStream%3CPath%3E directoryStream = Files.newDirectoryStream(source)) %7B%0A                for (Path path : directoryStream) %7B%0A                    copyRecursively(path, destinationPath, options);%0A                %7D%0A            %7D%0A        %7D else %7B%0A            Files.copy(source, destinationPath, options);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add FileUtils.