// Path: src/main/java/com/redhat/rcm/maven/plugin/buildmetadata/util/MojoFileUtils.java
// public final class MojoFileUtils
// {
//   // ********************************* Fields *********************************
// 
//   // --- constants ------------------------------------------------------------
// 
//   // --- members --------------------------------------------------------------
// 
//   // ****************************** Initializer *******************************
// 
//   // ****************************** Constructors ******************************
// 
//   private MojoFileUtils()
//   {
//   }
// 
//   // ****************************** Inner Classes *****************************
// 
//   // ********************************* Methods ********************************
// 
//   // --- init -----------------------------------------------------------------
// 
//   // --- get&set --------------------------------------------------------------
// 
//   // --- business -------------------------------------------------------------
// 
//   /**
//    * Ensures that the given directory exists.
//    *
//    * @param directory the directory to check. It is not checked, if this is a
//    *          directory or a file.
//    * @throws MojoExecutionException if the directory does not exist and cannot
//    *           be created.
//    */
//   public static void ensureExists(final File directory)
//     throws MojoExecutionException
//   {
//     if (!directory.exists())
//     {
//       final boolean created = directory.mkdirs();
//       if (!created)
//       {
//         throw new MojoExecutionException("Cannot create output directory '"
//                                          + directory + "'.");
//       }
//     }
//   }
// 
//   // --- object basics --------------------------------------------------------
// 
// }


import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import com.redhat.rcm.maven.plugin.buildmetadata.util.MojoFileUtils;
            "maven-source-plugin"));
    if (sourcesPlugin != null)
    {
      // TODO: Should we check if the plugin is to be run?
      return true;
    }

    return false;
  }

  private void addFileToSources(final File propertiesFile,
      final String targetLocation, final boolean attach)
    throws MojoExecutionException
  {
    final File testFile = new File(targetLocation);
    final File targetLocationDir;
    final File generatedSourcesMetaInfDir;

    if (testFile.isAbsolute())
    {
      targetLocationDir = null;
      generatedSourcesMetaInfDir = testFile;
    }
    else
    {
      targetLocationDir =
          new File(project.getBuild().getDirectory(), targetLocation);
      generatedSourcesMetaInfDir = new File(targetLocationDir, "META-INF");
    }

// Path: src/main/java/com/redhat/rcm/maven/plugin/buildmetadata/util/MojoFileUtils.java
// public final class MojoFileUtils
// {
//   // ********************************* Fields *********************************
// 
//   // --- constants ------------------------------------------------------------
// 
//   // --- members --------------------------------------------------------------
// 
//   // ****************************** Initializer *******************************
// 
//   // ****************************** Constructors ******************************
// 
//   private MojoFileUtils()
//   {
//   }
// 
//   // ****************************** Inner Classes *****************************
// 
//   // ********************************* Methods ********************************
// 
//   // --- init -----------------------------------------------------------------
// 
//   // --- get&set --------------------------------------------------------------
// 
//   // --- business -------------------------------------------------------------
// 
//   /**
//    * Ensures that the given directory exists.
//    *
//    * @param directory the directory to check. It is not checked, if this is a
//    *          directory or a file.
//    * @throws MojoExecutionException if the directory does not exist and cannot
//    *           be created.
//    */
//   public static void ensureExists(final File directory)
//     throws MojoExecutionException
//   {
//     if (!directory.exists())
//     {
//       final boolean created = directory.mkdirs();
//       if (!created)
//       {
//         throw new MojoExecutionException("Cannot create output directory '"
//                                          + directory + "'.");
//       }
//     }
//   }
// 
//   // --- object basics --------------------------------------------------------
// 
// }


// Path: src/main/java/com/redhat/rcm/maven/plugin/buildmetadata/io/AdditionalLocationsSupport.java
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import com.redhat.rcm.maven.plugin.buildmetadata.util.MojoFileUtils;

            "maven-source-plugin"));
    if (sourcesPlugin != null)
    {
      // TODO: Should we check if the plugin is to be run?
      return true;
    }

    return false;
  }

  private void addFileToSources(final File propertiesFile,
      final String targetLocation, final boolean attach)
    throws MojoExecutionException
  {
    final File testFile = new File(targetLocation);
    final File targetLocationDir;
    final File generatedSourcesMetaInfDir;

    if (testFile.isAbsolute())
    {
      targetLocationDir = null;
      generatedSourcesMetaInfDir = testFile;
    }
    else
    {
      targetLocationDir =
          new File(project.getBuild().getDirectory(), targetLocation);
      generatedSourcesMetaInfDir = new File(targetLocationDir, "META-INF");
    }

    MojoFileUtils.ensureExists(generatedSourcesMetaInfDir);