All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bazaarvoice.maven.plugin.s3repo.util.ExtraFileUtils Maven / Gradle / Ivy

There is a newer version: 3.7
Show newest version
package com.bazaarvoice.maven.plugin.s3repo.util;

import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.plexus.util.FileUtils;

import java.io.File;
import java.io.IOException;

public final class ExtraFileUtils {

    private ExtraFileUtils() {}

    public static void createOrCleanDirectory(File directory) throws MojoExecutionException {
        try {
            FileUtils.deleteDirectory(directory);
            FileUtils.mkdir(directory.getAbsolutePath());
        } catch (IOException e) {
            throw new MojoExecutionException("Failed to clean or create directory: " + directory, e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy