Package javax.jcr

Examples of javax.jcr.Session.logout()


            assertThat(content.getPrimaryNodeType().getName(), equalTo("custom"));

        } finally {
            session.removeItem("/content");
            session.save();
            session.logout();

            IOUtils.closeQuietly(cndInput);
        }
    }
View Full Code Here


            createWorkspace(w, "ws3");
        } catch (Exception e) {
            // ignore
        } finally {
            if (s != null) {
                s.logout();
            }
        }
    }

    @SuppressWarnings("unused")
View Full Code Here

            deleteWorkspace(w, "ws1");
        } catch (Exception e) {
            // ignore
        } finally {
            if (s != null) {
                s.logout();
            }
        }
    }

    private void createWorkspace(final Workspace w, final String name) {
View Full Code Here

            Node parent = session.getNode(Text.getRelativeParent(path, 1));
            parent.addNode(Text.getName(path), primaryNodeType);
            session.save();
        } finally {
            session.logout();
        }
    }

    public void createFile(String path, byte[] bytes) throws RepositoryException {
        Session session = login();
View Full Code Here

            Node contentNode = resourceNode.addNode("jcr:content", "nt:resource");
            contentNode
                    .setProperty("jcr:data", session.getValueFactory().createBinary(new ByteArrayInputStream(bytes)));
            session.save();
        } finally {
            session.logout();
        }
    }
   
    /**
     * Executes a user-specified <tt>runnable</tt> on the repository
View Full Code Here

        Session session = login();
        try {
            return runnable.doWithSession(session);
        } finally {
            session.logout();
        }
    }

    private Session login() throws RepositoryException {
       
View Full Code Here

        } finally {
          //cleanup
          if (observationManager != null) {
              observationManager.removeEventListener(listener);
          }
            jcrSession.logout();
            repository = null;
        }
    }
   
  protected class TestEventListener implements EventListener {
View Full Code Here

                final Node n = (Node)s.getItem(rootPath);
                findPathsUnderNode(n, result);
            }
        } finally {
            if (s != null) {
                s.logout();
            }
        }
    }

    /**
 
View Full Code Here

            } catch (final RepositoryException re) {
                logger.error("Unable to remove resource from " + path, re);
                return null;
            } finally {
                if ( session != null ) {
                    session.logout();
                }
            }
            return new UpdateResult(url);
        }
        // not provisioned by us
View Full Code Here

        } catch (final IOException e) {
            logger.error("Unable to add/update resource " + resourceType + ':' + id, e);
            return null;
        } finally {
            if ( session != null ) {
                session.logout();
            }
        }
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.