public class RepositoryUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RepositoryUtil.RepositoryWrapper |
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_NAME |
static String |
ADMIN_PASSWORD |
static String |
CONFIG_FILE |
static String |
HOME_DIR |
Constructor and Description |
---|
RepositoryUtil() |
Modifier and Type | Method and Description |
---|---|
static org.apache.sling.jcr.api.SlingRepository |
getRepository()
Get a repository
|
static boolean |
registerNodeType(javax.jcr.Session session,
InputStream source)
Registers node types from the CND file read from the
source
with the node type manager available from the given session . |
static void |
registerSlingNodeTypes(javax.jcr.Session adminSession) |
static void |
startRepository()
Start a new repository
|
static void |
stopRepository()
Stop a repository.
|
public static final String ADMIN_NAME
public static final String ADMIN_PASSWORD
public static final String HOME_DIR
public static final String CONFIG_FILE
public static void startRepository() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- when it is not possible to start the
repository.public static void stopRepository() throws NamingException
NamingException
public static org.apache.sling.jcr.api.SlingRepository getRepository()
public static boolean registerNodeType(javax.jcr.Session session, InputStream source) throws IOException, javax.jcr.RepositoryException
source
with the node type manager available from the given session
.
This method is not synchronized. It is up to the calling method to prevent paralell execution.
session
- The Session
providing the node type manager
through which the node type is to be registered.source
- The InputStream
from which the CND file is
read.true
if registration of all node types succeeded.IOException
javax.jcr.RepositoryException
public static void registerSlingNodeTypes(javax.jcr.Session adminSession) throws IOException, javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.