org.apache.myfaces.buildtools.maven2.plugin.builder
Class IOUtils

java.lang.Object
  extended by org.apache.myfaces.buildtools.maven2.plugin.builder.IOUtils

public class IOUtils
extends Object

Utilities to write a Model as xml, and read a Model in from xml.


Constructor Summary
IOUtils()
           
 
Method Summary
static boolean existsSourceFile(String filename, List sourceDirs)
           
static Model getModelFromArtifact(org.apache.maven.artifact.Artifact artifact)
           
static List getModelsFromArtifacts(org.apache.maven.project.MavenProject project)
          Scan every jarfile that this maven project has a dependency on, looking for metadata files.
static Model loadModel(File infile)
          Read the contents of the model from an xml file.
static Model readModel(Reader reader)
          Read the contents of the model from a provided Reader object.
static void saveModel(Model model, File outfile)
          Write the contents of the model to an xml file.
static void writeModel(Model model, Writer writer)
          Write the contents of the model to a provided Writer object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtils

public IOUtils()
Method Detail

saveModel

public static void saveModel(Model model,
                             File outfile)
                      throws org.apache.maven.plugin.MojoExecutionException
Write the contents of the model to an xml file.

Throws:
org.apache.maven.plugin.MojoExecutionException

writeModel

public static void writeModel(Model model,
                              Writer writer)
                       throws org.apache.maven.plugin.MojoExecutionException
Write the contents of the model to a provided Writer object.

Throws:
org.apache.maven.plugin.MojoExecutionException

loadModel

public static Model loadModel(File infile)
                       throws org.apache.maven.plugin.MojoExecutionException
Read the contents of the model from an xml file.

Throws:
org.apache.maven.plugin.MojoExecutionException

existsSourceFile

public static boolean existsSourceFile(String filename,
                                       List sourceDirs)

getModelFromArtifact

public static Model getModelFromArtifact(org.apache.maven.artifact.Artifact artifact)
                                  throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getModelsFromArtifacts

public static List getModelsFromArtifacts(org.apache.maven.project.MavenProject project)
                                   throws org.apache.maven.plugin.MojoExecutionException
Scan every jarfile that this maven project has a dependency on, looking for metadata files.

Each file found is loaded into memory as a Model object and added to the list.

Throws:
org.apache.maven.plugin.MojoExecutionException

readModel

public static Model readModel(Reader reader)
                       throws org.apache.maven.plugin.MojoExecutionException
Read the contents of the model from a provided Reader object.

Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.