當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。