gpt4 book ai didi

org.apache.archiva.xml.XMLException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 09:13:05 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.archiva.xml.XMLException类的一些代码示例,展示了XMLException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLException类的具体详情如下:
包路径:org.apache.archiva.xml.XMLException
类名称:XMLException

XMLException介绍

[英]XMLException
[中]XMLException

代码示例

代码示例来源:origin: apache/archiva

private ArchivaRepositoryMetadata getMetadata( Path metadataFile )
  throws RepositoryMetadataException
{
  ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
  if ( Files.exists(metadataFile) )
  {
    try
    {
      metadata = MavenMetadataReader.read( metadataFile );
    }
    catch ( XMLException e )
    {
      throw new RepositoryMetadataException( e.getMessage(), e );
    }
  }
  return metadata;
}

代码示例来源:origin: org.apache.archiva/archiva-xml-tools

public XMLReader( String type, File file )
  throws XMLException
{
  if ( !file.exists() )
  {
    throw new XMLException( "file does not exist: " + file.getAbsolutePath() );
  }
  if ( !file.isFile() )
  {
    throw new XMLException( "path is not a file: " + file.getAbsolutePath() );
  }
  if ( !file.canRead() )
  {
    throw new XMLException( "Cannot read xml file due to permissions: " + file.getAbsolutePath() );
  }
  try
  {
    init( type, file.toURL() );
  }
  catch ( MalformedURLException e )
  {
    throw new XMLException( "Unable to translate file " + file + " to URL: " + e.getMessage(), e );
  }
}

代码示例来源:origin: org.apache.archiva/maven2-repository

log.warn( "fail to read {}, {}", mavenMetadata.getAbsolutePath(), e.getCause() );

代码示例来源:origin: apache/archiva

log.warn( "fail to read {}, {}", mavenMetadata.toAbsolutePath(), e.getCause() );

代码示例来源:origin: apache/archiva

private ArchivaRepositoryMetadata getMetadata( Path metadataFile )
  throws RepositoryMetadataException
{
  ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
  if ( Files.exists(metadataFile) )
  {
    try
    {
      metadata = MavenMetadataReader.read( metadataFile );
    }
    catch ( XMLException e )
    {
      throw new RepositoryMetadataException( e.getMessage(), e );
    }
  }
  return metadata;
}

代码示例来源:origin: apache/archiva

public XMLReader( String type, Path file )
  throws XMLException
{
  if ( !Files.exists(file) )
  {
    throw new XMLException( "file does not exist: " + file.toAbsolutePath() );
  }
  if ( !Files.isRegularFile(file) )
  {
    throw new XMLException( "path is not a file: " + file.toAbsolutePath() );
  }
  if ( !Files.isReadable(file) )
  {
    throw new XMLException( "Cannot read xml file due to permissions: " + file.toAbsolutePath() );
  }
  try
  {
    init( type, file.toUri().toURL() );
  }
  catch ( MalformedURLException e )
  {
    throw new XMLException( "Unable to translate file " + file + " to URL: " + e.getMessage(), e );
  }
}

代码示例来源:origin: apache/archiva

private ArchivaRepositoryMetadata getMetadata( Path metadataFile )
  throws RepositoryMetadataException
{
  ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
  if ( Files.exists(metadataFile) )
  {
    try
    {
      metadata = MavenMetadataReader.read( metadataFile );
    }
    catch ( XMLException e )
    {
      throw new RepositoryMetadataException( e.getMessage(), e );
    }
  }
  return metadata;
}

代码示例来源:origin: apache/archiva

throw new XMLException( "Unable to parse " + documentType + " xml " + xmlUrl + ": " + e.getMessage(), e );
  throw new XMLException( "Unable to open stream to " + url + ": " + e.getMessage(), e );
if ( root == null )
  throw new XMLException( "Invalid " + documentType + " xml: root element is null." );
  throw new XMLException(
    "Invalid " + documentType + " xml: Unexpected root element <" + root.getName() + ">, expected <"
      + documentType + ">" );

代码示例来源:origin: org.apache.archiva/archiva-web-common

private ArchivaRepositoryMetadata getMetadata( File metadataFile )
  throws RepositoryMetadataException
{
  ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
  if ( metadataFile.exists() )
  {
    try
    {
      metadata = MavenMetadataReader.read( metadataFile );
    }
    catch ( XMLException e )
    {
      throw new RepositoryMetadataException( e.getMessage(), e );
    }
  }
  return metadata;
}

代码示例来源:origin: org.apache.archiva/archiva-xml-tools

throw new XMLException( "Unable to parse " + documentType + " xml " + xmlUrl + ": " + e.getMessage(), e );
  throw new XMLException( "Unable to open stream to " + url + ": " + e.getMessage(), e );
if ( root == null )
  throw new XMLException( "Invalid " + documentType + " xml: root element is null." );
  throw new XMLException(
    "Invalid " + documentType + " xml: Unexpected root element <" + root.getName() + ">, expected <"
      + documentType + ">" );

代码示例来源:origin: org.apache.archiva/archiva-rest-services

private ArchivaRepositoryMetadata getMetadata( File metadataFile )
  throws RepositoryMetadataException
{
  ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
  if ( metadataFile.exists() )
  {
    try
    {
      metadata = MavenMetadataReader.read( metadataFile );
    }
    catch ( XMLException e )
    {
      throw new RepositoryMetadataException( e.getMessage(), e );
    }
  }
  return metadata;
}

代码示例来源:origin: apache/archiva

public Element getElement( String xpathExpr )
  throws XMLException
{
  XPath xpath = createXPath( xpathExpr );
  Object evaluated = xpath.selectSingleNode( document );
  if ( evaluated == null )
  {
    return null;
  }
  if ( evaluated instanceof Element )
  {
    return (Element) evaluated;
  }
  else
  {
    // Unknown evaluated type.
    throw new XMLException( ".getElement( Expr: " + xpathExpr + " ) resulted in non-Element type -> ("
                  + evaluated.getClass().getName() + ") " + evaluated );
  }
}

代码示例来源:origin: apache/archiva

log.warn( "skip fail to find timestamped snapshot pom: {}", e.getMessage() );

代码示例来源:origin: org.apache.archiva/archiva-xml-tools

public Element getElement( String xpathExpr )
  throws XMLException
{
  XPath xpath = createXPath( xpathExpr );
  Object evaluated = xpath.selectSingleNode( document );
  if ( evaluated == null )
  {
    return null;
  }
  if ( evaluated instanceof Element )
  {
    return (Element) evaluated;
  }
  else
  {
    // Unknown evaluated type.
    throw new XMLException( ".getElement( Expr: " + xpathExpr + " ) resulted in non-Element type -> ("
                  + evaluated.getClass().getName() + ") " + evaluated );
  }
}

代码示例来源:origin: org.apache.archiva/maven2-repository

log.warn( "skip fail to find timestamped snapshot pom: {}", e.getMessage() );

代码示例来源:origin: apache/archiva

throw new XMLException( ".getElementList( Expr: " + xpathExpr + " ) resulted in non-List type -> ("
              + evaluated.getClass().getName() + ") " + evaluated );

代码示例来源:origin: apache/archiva

log.warn( "skip fail to find timestamped snapshot file: {}", e.getMessage() );

代码示例来源:origin: org.apache.archiva/archiva-xml-tools

throw new XMLException( ".getElementList( Expr: " + xpathExpr + " ) resulted in non-List type -> ("
              + evaluated.getClass().getName() + ") " + evaluated );

代码示例来源:origin: org.apache.archiva/archiva-rest-services

log.warn( "skip fail to find timestamped snapshot file: {}", e.getMessage() );

代码示例来源:origin: apache/archiva

public String getElementText( Node context, String xpathExpr )
  throws XMLException
{
  XPath xpath = createXPath( xpathExpr );
  Object evaluated = xpath.selectSingleNode( context );
  if ( evaluated == null )
  {
    return null;
  }
  if ( evaluated instanceof Element )
  {
    Element evalElem = (Element) evaluated;
    return evalElem.getTextTrim();
  }
  else
  {
    // Unknown evaluated type.
    throw new XMLException( ".getElementText( Node, Expr: " + xpathExpr + " ) resulted in non-Element type -> ("
                  + evaluated.getClass().getName() + ") " + evaluated );
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com