本文整理匯總了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);
}
}