本文整理汇总了Java中org.codehaus.plexus.util.xml.pull.XmlPullParserException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java XmlPullParserException.getMessage方法的具体用法?Java XmlPullParserException.getMessage怎么用?Java XmlPullParserException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.plexus.util.xml.pull.XmlPullParserException
的用法示例。
在下文中一共展示了XmlPullParserException.getMessage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getArchetypeCatalog
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
public ArchetypeCatalog getArchetypeCatalog()
throws IOException, ArchetypeCatalogNotFoundException
{
File file = new File( root, "archetype-catalog.xml" );
if ( !file.isFile() )
{
throw new ArchetypeCatalogNotFoundException();
}
ArchetypeCatalogXpp3Reader reader = new ArchetypeCatalogXpp3Reader();
InputStream inputStream = null;
try
{
inputStream = new FileInputStream( file );
return reader.read( inputStream );
}
catch ( XmlPullParserException e )
{
IOException ioe = new IOException( e.getMessage() );
ioe.initCause( e );
throw ioe;
}
finally
{
IOUtils.closeQuietly( inputStream );
}
}
示例2: getArchetypeCatalog
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
public synchronized ArchetypeCatalog getArchetypeCatalog()
throws IOException, ArchetypeCatalogNotFoundException
{
if ( archetypeCatalog != null )
{
ArchetypeCatalogXpp3Reader reader = new ArchetypeCatalogXpp3Reader();
InputStream inputStream = null;
try
{
inputStream = new ByteArrayInputStream( archetypeCatalog.getBytes() );
return reader.read( inputStream );
}
catch ( XmlPullParserException e )
{
throw new ArchetypeCatalogNotFoundException( e.getMessage(), e );
}
finally
{
IOUtils.closeQuietly( inputStream );
}
}
else
{
throw new ArchetypeCatalogNotFoundException();
}
}
示例3: getArchetypeCatalog
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
public ArchetypeCatalog getArchetypeCatalog()
throws IOException, ArchetypeCatalogNotFoundException
{
Entry entry = backing.get( "archetype-catalog.xml" );
if ( !( entry instanceof FileEntry ) )
{
throw new ArchetypeCatalogNotFoundException();
}
ArchetypeCatalogXpp3Reader reader = new ArchetypeCatalogXpp3Reader();
InputStream inputStream = null;
try
{
inputStream = ( (FileEntry) entry ).getInputStream();
return reader.read( inputStream );
}
catch ( XmlPullParserException e )
{
IOException ioe = new IOException( e.getMessage() );
ioe.initCause( e );
throw ioe;
}
finally
{
IOUtils.closeQuietly( inputStream );
}
}
示例4: getRawModel
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
/**
* Gets the current raw model before any interpolation what-so-ever.
*
* @param modifiedPomXMLEventReader The {@link ModifiedPomXMLEventReader} to get the raw model for.
* @return The raw model.
* @throws IOException if the file is not found or if the file does not parse.
*/
public static Model getRawModel( ModifiedPomXMLEventReader modifiedPomXMLEventReader )
throws IOException
{
StringReader stringReader = null;
try
{
stringReader = new StringReader( modifiedPomXMLEventReader.asStringBuilder().toString() );
MavenXpp3Reader reader = new MavenXpp3Reader();
return reader.read( stringReader );
}
catch ( XmlPullParserException e )
{
IOException ioe = new IOException( e.getMessage() );
ioe.initCause( e );
throw ioe;
}
finally
{
if ( stringReader != null )
{
stringReader.close();
}
}
}
示例5: read
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
public Metadata read( Reader input, Map<String, ?> options )
throws IOException
{
if ( input == null )
{
throw new IllegalArgumentException( "input reader missing" );
}
try
{
MetadataXpp3Reader r = new MetadataXpp3Reader();
return r.read( input, isStrict( options ) );
}
catch ( XmlPullParserException e )
{
throw new MetadataParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
}
finally
{
IOUtil.close( input );
}
}
示例6: read
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
public Settings read( Reader input, Map<String, ?> options )
throws IOException
{
if ( input == null )
{
throw new IllegalArgumentException( "input reader missing" );
}
try
{
SettingsXpp3Reader r = new SettingsXpp3Reader();
return r.read( input, isStrict( options ) );
}
catch ( XmlPullParserException e )
{
throw new SettingsParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
}
finally
{
IOUtil.close( input );
}
}
示例7: read
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
private Model read( Reader reader, boolean strict, InputSource source )
throws IOException
{
try
{
if ( source != null )
{
return new MavenXpp3ReaderEx().read( reader, strict, source );
}
else
{
return new MavenXpp3Reader().read( reader, strict );
}
}
catch ( XmlPullParserException e )
{
throw new ModelParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
}
}
示例8: getMetadata
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public Metadata getMetadata( String path )
throws IOException, MetadataNotFoundException
{
File file = root;
String[] parts = StringUtils.strip( path, "/" ).split( "/" );
for ( int i = 0; i < parts.length; i++ )
{
file = new File( file, parts[i] );
}
file = new File( file, "maven-metadata.xml" );
if ( !file.isFile() )
{
throw new MetadataNotFoundException( path );
}
MetadataXpp3Reader reader = new MetadataXpp3Reader();
InputStream inputStream = null;
try
{
inputStream = new FileInputStream( file );
return reader.read( inputStream );
}
catch ( XmlPullParserException e )
{
IOException ioe = new IOException( e.getMessage() );
ioe.initCause( e );
throw ioe;
}
finally
{
IOUtils.closeQuietly( inputStream );
}
}
示例9: getMetadata
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public Metadata getMetadata( String path )
throws IOException, MetadataNotFoundException
{
Entry entry = backing.get(
StringUtils.join( StringUtils.split( StringUtils.strip( path, "/" ), "/" ), "/" ) + "/maven-metadata.xml" );
if ( !( entry instanceof FileEntry ) )
{
throw new MetadataNotFoundException( path );
}
MetadataXpp3Reader reader = new MetadataXpp3Reader();
InputStream inputStream = null;
try
{
inputStream = ( (FileEntry) entry ).getInputStream();
return reader.read( inputStream );
}
catch ( XmlPullParserException e )
{
IOException ioe = new IOException( e.getMessage() );
ioe.initCause( e );
throw ioe;
}
finally
{
IOUtils.closeQuietly( inputStream );
}
}
示例10: getRawModel
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
/**
* Gets the raw model before any interpolation what-so-ever.
*
* @param moduleProjectFile The project file to get the raw model for.
* @return The raw model.
* @throws IOException if the file is not found or if the file does not parse.
*/
public static Model getRawModel( File moduleProjectFile )
throws IOException
{
try (FileInputStream input = new FileInputStream( moduleProjectFile ))
{
return new MavenXpp3Reader().read( input );
}
catch ( XmlPullParserException e )
{
throw new IOException( e.getMessage(), e );
}
}
示例11: toMavenMetadata
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //导入方法依赖的package包/类
/**
* Creates a maven <code>Metadata</code> out of a <code>java.io.Reader</code> and will close the reader.
*
* @param reader Reader representing content of maven-metadata.xml
* @return Metadata object created from the reader
* @throws java.io.IOException If the input reader doesn't holds a valid maven metadata
*/
public static Metadata toMavenMetadata(Reader reader) throws IOException {
MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
try {
return metadataReader.read(reader, false);
} catch (XmlPullParserException e) {
throw new IOException("Failed to parse metadata: " + e.getMessage());
} finally {
IOUtils.closeQuietly(reader);
}
}