Java Code Examples for org.codehaus.plexus.util.ReaderFactory#newXmlReader()

The following examples show how to use org.codehaus.plexus.util.ReaderFactory#newXmlReader() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PomHelper.java    From versions-maven-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * Reads a file into a String.
 *
 * @param outFile The file to read.
 * @return String The content of the file.
 * @throws java.io.IOException when things go wrong.
 */
public static StringBuilder readXmlFile( File outFile )
    throws IOException
{
    try( Reader reader = ReaderFactory.newXmlReader( outFile ) )
    {
        return new StringBuilder( IOUtil.toString( reader ) );
    }
}
 
Example 2
Source File: LegacyPluginDescriptors.java    From takari-lifecycle with Eclipse Public License 1.0 5 votes vote down vote up
public static Collection<MojoDescriptor> readMojos(InputStream is) throws IOException, XmlPullParserException {
  Reader reader = ReaderFactory.newXmlReader(is);
  org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor;
  try {
    pluginDescriptor = new PluginDescriptorBuilder().build(reader);
  } catch (PlexusConfigurationException e) {
    Throwables.propagateIfPossible(e.getCause(), IOException.class, XmlPullParserException.class);
    throw Throwables.propagate(e);
  }
  List<MojoDescriptor> result = new ArrayList<>();
  for (org.apache.maven.plugin.descriptor.MojoDescriptor mojo : pluginDescriptor.getMojos()) {
    result.add(toMojoDescriptor(mojo));
  }
  return result;
}
 
Example 3
Source File: NetbeansBuildActionXpp3Reader.java    From netbeans with Apache License 2.0 3 votes vote down vote up
/**
 * Method read.
 * 
 * @param in
 * @param strict
 * @throws IOException
 * @throws XmlPullParserException
 * @return ActionToGoalMapping
 */
public ActionToGoalMapping read(InputStream in, boolean strict)
    throws IOException, XmlPullParserException
{
    Reader reader = ReaderFactory.newXmlReader( in );
    
    return read( reader, strict );
}
 
Example 4
Source File: NetbeansBuildActionXpp3Reader.java    From netbeans with Apache License 2.0 3 votes vote down vote up
/**
 * Method read.
 * 
 * @param in
 * @throws IOException
 * @throws XmlPullParserException
 * @return ActionToGoalMapping
 */
public ActionToGoalMapping read(InputStream in)
    throws IOException, XmlPullParserException
{
    Reader reader = ReaderFactory.newXmlReader( in );
    
    return read( reader );
}