当前位置: 首页>>代码示例>>Java>>正文


Java XmlPullParserException.getMessage方法代码示例

本文整理汇总了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 );
    }
}
 
开发者ID:mojohaus,项目名称:mrm,代码行数:27,代码来源:DiskArtifactStore.java

示例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();
    }
}
 
开发者ID:mojohaus,项目名称:mrm,代码行数:27,代码来源:MemoryArtifactStore.java

示例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 );
    }
}
 
开发者ID:mojohaus,项目名称:mrm,代码行数:27,代码来源:FileSystemArtifactStore.java

示例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();
        }
    }
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:32,代码来源:PomHelper.java

示例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 );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:DefaultMetadataReader.java

示例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 );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:DefaultSettingsReader.java

示例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 );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:20,代码来源:DefaultModelReader.java

示例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 );
    }
}
 
开发者ID:mojohaus,项目名称:mrm,代码行数:36,代码来源:DiskArtifactStore.java

示例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 );
    }
}
 
开发者ID:mojohaus,项目名称:mrm,代码行数:31,代码来源:FileSystemArtifactStore.java

示例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 );
    }
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:20,代码来源:PomHelper.java

示例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);
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:18,代码来源:MavenModelUtils.java


注:本文中的org.codehaus.plexus.util.xml.pull.XmlPullParserException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。