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


Java RepositoryException.getMessage方法代码示例

本文整理汇总了Java中javax.jcr.RepositoryException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryException.getMessage方法的具体用法?Java RepositoryException.getMessage怎么用?Java RepositoryException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.jcr.RepositoryException的用法示例。


在下文中一共展示了RepositoryException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addMetadataFacet

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
    throws MetadataRepositoryException
{
    try
    {
        Node repo = getOrAddRepositoryNode( repositoryId );
        Node facets = JcrUtils.getOrAddNode( repo, "facets" );

        String id = metadataFacet.getFacetId();
        Node facetNode = JcrUtils.getOrAddNode( facets, id );

        Node node = getOrAddNodeByPath( facetNode, metadataFacet.getName() );

        for ( Map.Entry<String, String> entry : metadataFacet.toProperties().entrySet() )
        {
            node.setProperty( entry.getKey(), entry.getValue() );
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:25,代码来源:JcrMetadataRepository.java

示例2: removeNamespace

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeNamespace( String repositoryId, String projectId )
    throws MetadataRepositoryException
{
    try
    {
        Node root = getJcrSession().getRootNode();
        String path = getNamespacePath( repositoryId, projectId );
        if ( root.hasNode( path ) )
        {
            Node node = root.getNode( path );
            if ( node.isNodeType( NAMESPACE_NODE_TYPE ) )
            {
                node.remove();
            }
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:23,代码来源:JcrMetadataRepository.java

示例3: removeMetadataFacets

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeMetadataFacets( String repositoryId, String facetId )
    throws MetadataRepositoryException
{
    try
    {
        Node root = getJcrSession().getRootNode();
        String path = getFacetPath( repositoryId, facetId );
        if ( root.hasNode( path ) )
        {
            root.getNode( path ).remove();
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:JcrMetadataRepository.java

示例4: removeMetadataFacet

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeMetadataFacet( String repositoryId, String facetId, String name )
    throws MetadataRepositoryException
{
    try
    {
        Node root = getJcrSession().getRootNode();
        String path = getFacetPath( repositoryId, facetId, name );
        if ( root.hasNode( path ) )
        {
            Node node = root.getNode( path );
            do
            {
                // also remove empty container nodes
                Node parent = node.getParent();
                node.remove();
                node = parent;
            }
            while ( !node.hasNodes() );
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:27,代码来源:JcrMetadataRepository.java

示例5: removeRepository

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeRepository( String repositoryId )
    throws MetadataRepositoryException
{
    try
    {
        Node root = getJcrSession().getRootNode();
        String path = getRepositoryPath( repositoryId );
        if ( root.hasNode( path ) )
        {
            root.getNode( path ).remove();
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:JcrMetadataRepository.java

示例6: getProject

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public ProjectMetadata getProject( String repositoryId, String namespace, String projectId )
    throws MetadataResolutionException
{
    ProjectMetadata metadata = null;

    try
    {
        Node root = getJcrSession().getRootNode();

        // basically just checking it exists
        String path = getProjectPath( repositoryId, namespace, projectId );
        if ( root.hasNode( path ) )
        {
            metadata = new ProjectMetadata();
            metadata.setId( projectId );
            metadata.setNamespace( namespace );
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataResolutionException( e.getMessage(), e );
    }

    return metadata;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:27,代码来源:JcrMetadataRepository.java

示例7: removeProjectVersion

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
    throws MetadataRepositoryException
{
    try
    {

        String path = getProjectPath( repoId, namespace, projectId );
        Node root = getJcrSession().getRootNode();

        Node nodeAtPath = root.getNode( path );

        for ( Node node : JcrUtils.getChildNodes( nodeAtPath ) )
        {
            if ( node.isNodeType( PROJECT_VERSION_NODE_TYPE ) && StringUtils.equals( projectVersion,
                                                                                     node.getName() ) )
            {
                node.remove();
            }
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:27,代码来源:JcrMetadataRepository.java

示例8: updateProject

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
private void updateProject( String repositoryId, String namespace, String projectId )
    throws MetadataRepositoryException
{
    updateNamespace( repositoryId, namespace );

    try
    {
        getOrAddProjectNode( repositoryId, namespace, projectId );
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:15,代码来源:JcrMetadataRepository.java

示例9: updateNamespace

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void updateNamespace( String repositoryId, String namespace )
    throws MetadataRepositoryException
{
    try
    {
        Node node = getOrAddNamespaceNode( repositoryId, namespace );
        node.setProperty( "namespace", namespace );
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:15,代码来源:JcrMetadataRepository.java

示例10: removeProject

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeProject( String repositoryId, String namespace, String projectId )
    throws MetadataRepositoryException
{
    try
    {
        Node root = getJcrSession().getRootNode();
        String namespacePath = getNamespacePath( repositoryId, namespace );

        if ( root.hasNode( namespacePath ) )
        {
            Iterator<Node> nodeIterator = JcrUtils.getChildNodes( root.getNode( namespacePath ) ).iterator();
            while ( nodeIterator.hasNext() )
            {
                Node node = nodeIterator.next();
                if ( node.isNodeType( PROJECT_NODE_TYPE ) && projectId.equals( node.getName() ) )
                {
                    node.remove();
                }
            }

        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }

}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:30,代码来源:JcrMetadataRepository.java

示例11: getRepositories

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public Collection<String> getRepositories()
    throws MetadataRepositoryException
{
    List<String> repositories;

    try
    {
        Node root = getJcrSession().getRootNode();
        if ( root.hasNode( "repositories" ) )
        {
            Node node = root.getNode( "repositories" );

            repositories = new ArrayList<>();
            NodeIterator i = node.getNodes();
            while ( i.hasNext() )
            {
                Node n = i.nextNode();
                repositories.add( n.getName() );
            }
        }
        else
        {
            repositories = Collections.emptyList();
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
    return repositories;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:33,代码来源:JcrMetadataRepository.java

示例12: getArtifactsByChecksum

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public List<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum )
    throws MetadataRepositoryException
{
    List<ArtifactMetadata> artifacts;

    String q = getArtifactQuery( repositoryId ) + " AND ([sha1] = $checksum OR [md5] = $checksum)";

    try
    {
        Query query = getJcrSession().getWorkspace().getQueryManager().createQuery( q, Query.JCR_SQL2 );
        ValueFactory valueFactory = getJcrSession().getValueFactory();
        query.bindValue( "checksum", valueFactory.createValue( checksum ) );
        QueryResult result = query.execute();

        artifacts = new ArrayList<>();
        for ( Node n : JcrUtils.getNodes( result ) )
        {
            artifacts.add( getArtifactFromNode( repositoryId, n ) );
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
    return artifacts;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:28,代码来源:JcrMetadataRepository.java

示例13: getArtifacts

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public List<ArtifactMetadata> getArtifacts( String repositoryId )
    throws MetadataRepositoryException
{
    List<ArtifactMetadata> artifacts;

    String q = getArtifactQuery( repositoryId );

    try
    {
        Query query = getJcrSession().getWorkspace().getQueryManager().createQuery( q, Query.JCR_SQL2 );
        QueryResult result = query.execute();

        artifacts = new ArrayList<>();
        for ( Node n : JcrUtils.getNodes( result ) )
        {
            if ( n.isNodeType( ARTIFACT_NODE_TYPE ) )
            {
                artifacts.add( getArtifactFromNode( repositoryId, n ) );
            }
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
    return artifacts;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:29,代码来源:JcrMetadataRepository.java

示例14: revert

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void revert()
{
    try
    {
        getJcrSession().refresh( false );
    }
    catch ( RepositoryException e )
    {
        throw new RuntimeException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:13,代码来源:JcrMetadataRepository.java

示例15: removeArtifact

import javax.jcr.RepositoryException; //导入方法依赖的package包/类
@Override
public void removeArtifact( String repositoryId, String namespace, String projectId, String projectVersion,
                            String id )
    throws MetadataRepositoryException
{
    try
    {
        Node root = getJcrSession().getRootNode();
        String path = getArtifactPath( repositoryId, namespace, projectId, projectVersion, id );
        if ( root.hasNode( path ) )
        {
            root.getNode( path ).remove();
        }

        // remove version

        path = getProjectPath( repositoryId, namespace, projectId );

        Node nodeAtPath = root.getNode( path );

        for ( Node node : JcrUtils.getChildNodes( nodeAtPath ) )
        {
            if ( node.isNodeType( PROJECT_VERSION_NODE_TYPE ) //
                && StringUtils.equals( node.getName(), projectVersion ) )
            {
                node.remove();
            }
        }
    }
    catch ( RepositoryException e )
    {
        throw new MetadataRepositoryException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:35,代码来源:JcrMetadataRepository.java


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