code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
protected String createDefaultExcerpt(String text,
String excerptStart,
String excerptEnd,
String fragmentStart,
String fragmentEnd,
... | java |
protected void putItem(final ItemData data)
{
cache.put(new CacheId(data.getIdentifier()), new CacheValue(data, System.currentTimeMillis() + liveTime));
cache.put(new CacheQPath(data.getParentIdentifier(), data.getQPath(), ItemType.getItemType(data)),
new CacheValue(data, System.currentTimeMilli... | java |
protected ItemData getItem(final String identifier)
{
long start = System.currentTimeMillis();
try
{
final CacheId k = new CacheId(identifier);
final CacheValue v = cache.get(k);
if (v != null)
{
final ItemData c = v.getItem();
if (v.getE... | java |
public void setLiveTime(long liveTime)
{
writeLock.lock();
try
{
this.liveTime = liveTime;
}
finally
{
writeLock.unlock();
}
LOG
.info(name + " : set liveTime=" + liveTime + "ms. New value will be applied to items cached from this moment.");
... | java |
protected void removeItem(final ItemData item)
{
final String itemId = item.getIdentifier();
cache.remove(new CacheId(itemId));
final CacheValue v2 =
cache.remove(new CacheQPath(item.getParentIdentifier(), item.getQPath(), ItemType.getItemType(item)));
if (v2 != null && !v2.getItem... | java |
protected PropertyData removeChildProperty(final String parentIdentifier, final String childIdentifier)
{
final List<PropertyData> childProperties = propertiesCache.get(parentIdentifier);
if (childProperties != null)
{
synchronized (childProperties)
{ // [PN] 17.01.07
... | java |
protected NodeData removeChildNode(final String parentIdentifier, final String childIdentifier)
{
final List<NodeData> childNodes = nodesCache.get(parentIdentifier);
if (childNodes != null)
{
synchronized (childNodes)
{ // [PN] 17.01.07
for (Iterator<NodeData> i = chil... | java |
String dump()
{
StringBuilder res = new StringBuilder();
for (Map.Entry<CacheKey, CacheValue> ce : cache.entrySet())
{
res.append(ce.getKey().hashCode());
res.append("\t\t");
res.append(ce.getValue().getItem().getIdentifier());
res.append(", ");
res.appe... | java |
final protected void restore() throws RepositoryRestoreExeption
{
try
{
stateRestore = REPOSITORY_RESTORE_STARTED;
startTime = Calendar.getInstance();
restoreRepository();
stateRestore = REPOSITORY_RESTORE_SUCCESSFUL;
endTime = Calendar.getInstance();
... | java |
protected void removeRepository(RepositoryService repositoryService, String repositoryName)
throws RepositoryException,
RepositoryConfigurationException
{
ManageableRepository mr = null;
try
{
mr = repositoryService.getRepository(repositoryName);
}
catch (Repositor... | java |
private void closeAllSession(ManageableRepository mr) throws NoSuchWorkspaceException
{
for (String wsName : mr.getWorkspaceNames())
{
if (!mr.canRemoveWorkspace(wsName))
{
WorkspaceContainerFacade wc = mr.getWorkspaceContainer(wsName);
SessionRegistry sessionReg... | java |
protected List<ItemState> findItemStates(QPath itemPath)
{
List<ItemState> istates = new ArrayList<ItemState>();
for (ItemState istate : itemAddStates)
{
if (istate.getData().getQPath().equals(itemPath))
istates.add(istate);
}
return istates;
} | java |
protected ItemState findLastItemState(QPath itemPath)
{
for (int i = itemAddStates.size() - 1; i >= 0; i--)
{
ItemState istate = itemAddStates.get(i);
if (istate.getData().getQPath().equals(itemPath))
return istate;
}
return null;
} | java |
public List<NodeTypeData> read(InputStream is) throws RepositoryException
{
try
{
if (is != null)
{
/** Lexing input stream */
CNDLexer lex = new CNDLexer(new ANTLRInputStream(is));
CommonTokenStream tokens = new CommonTokenStream(lex);
/*... | java |
protected void execute(List<String> scripts) throws SQLException
{
SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
// set needed auto commit mode
boolean autoCommit = connection.getAutoCommit();
if (autoCommit != this.autoCommit)
{
... | java |
private void initOrderedIterator()
{
if (orderedNodes != null)
{
return;
}
long time = 0;
if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
ScoreNode[][] nodes = (ScoreNode[][])scoreNodes.toArray(new ScoreNode[scoreNodes.size()][]);
... | java |
public static File getFullBackupFile(File restoreDir)
{
Pattern p = Pattern.compile(".+\\.0");
for (File f : PrivilegedFileHelper.listFiles(restoreDir, new FileFilter()
{
public boolean accept(File pathname)
{
Pattern p = Pattern.compile(".+\\.[0-9]+");
... | java |
public static List<File> getIncrementalFiles(File restoreDir)
{
ArrayList<File> list = new ArrayList<File>();
Pattern fullBackupPattern = Pattern.compile(".+\\.0");
for (File f : PrivilegedFileHelper.listFiles(restoreDir, new FileFilter()
{
public boolean accept(File pathna... | java |
public void incrementalRestore(File incrementalBackupFile) throws FileNotFoundException, IOException,
ClassNotFoundException, RepositoryException
{
ObjectInputStream ois = null;
try
{
ois = new ObjectInputStream(PrivilegedFileHelper.fileInputStream(incrementalBackupFile));
... | java |
public long getNodeChangedSize(String nodePath)
{
Long delta = calculatedChangedNodesSize.get(nodePath);
return delta == null ? 0 : delta;
} | java |
public void merge(ChangesItem changesItem)
{
workspaceChangedSize += changesItem.getWorkspaceChangedSize();
for (Entry<String, Long> changesEntry : changesItem.calculatedChangedNodesSize.entrySet())
{
String nodePath = changesEntry.getKey();
Long currentDelta = changesEntry.getVa... | java |
public static boolean isFile(Node node)
{
try
{
if (!node.isNodeType("nt:file"))
return false;
if (!node.getNode("jcr:content").isNodeType("nt:resource"))
return false;
return true;
}
catch (RepositoryException exc)
{
... | java |
public static boolean isVersion(Node node)
{
try
{
if (node.isNodeType("nt:version"))
return true;
return false;
}
catch (RepositoryException exc)
{
LOG.error(exc.getMessage(), exc);
return false;
}
} | java |
private void validateNodeType(NodeTypeData nodeType) throws RepositoryException
{
if (nodeType == null)
{
throw new RepositoryException("NodeType object " + nodeType + " is null");
}
if (nodeType.getName() == null)
{
throw new RepositoryException("NodeType implementat... | java |
public Version version(String versionName, boolean pool) throws VersionException, RepositoryException
{
JCRName jcrVersionName = locationFactory.parseJCRName(versionName);
VersionImpl version =
(VersionImpl)dataManager.getItem(nodeData(), new QPathEntry(jcrVersionName.getInternalName(), 1), pool... | java |
void migrate() throws RepositoryException
{
try
{
LOG.info("Migration started.");
moveOldStructure();
service.createStructure();
//Migration order is important due to removal of nodes.
migrateGroups();
migrateMembershipTypes();
migrateUsers... | java |
boolean migrationRequired() throws RepositoryException
{
Session session = service.getStorageSession();
try
{
if (session.itemExists(storagePathOld))
{
return true;
}
try
{
Node node = (Node)session.getItem(service.getStoragePat... | java |
private void moveOldStructure() throws Exception
{
ExtendedSession session = (ExtendedSession)service.getStorageSession();
try
{
if (session.itemExists(storagePathOld))
{
return;
}
else
{
session.move(service.getStoragePath(), sto... | java |
private void removeOldStructure() throws RepositoryException
{
ExtendedSession session = (ExtendedSession)service.getStorageSession();
try
{
if (session.itemExists(storagePathOld))
{
NodeIterator usersIter = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazi... | java |
private void migrateUsers() throws Exception
{
Session session = service.getStorageSession();
try
{
if (session.itemExists(usersStorageOld))
{
NodeIterator iterator = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazily();
UserHandlerImpl uh = ((... | java |
private void migrateGroups() throws Exception
{
Session session = service.getStorageSession();
try
{
if (session.itemExists(groupsStorageOld))
{
NodeIterator iterator = ((ExtendedNode)session.getItem(groupsStorageOld)).getNodesLazily();
GroupHandlerImpl gh ... | java |
private void migrateGroups(Node startNode) throws Exception
{
NodeIterator iterator = ((ExtendedNode)startNode).getNodesLazily();
GroupHandlerImpl gh = ((GroupHandlerImpl)service.getGroupHandler());
while (iterator.hasNext())
{
Node oldGroupNode = iterator.nextNode();
gh.mig... | java |
private void migrateMembershipTypes() throws Exception
{
Session session = service.getStorageSession();
try
{
if (session.itemExists(membershipTypesStorageOld))
{
NodeIterator iterator = ((ExtendedNode)session.getItem(membershipTypesStorageOld)).getNodesLazily();
... | java |
private void migrateProfiles() throws Exception
{
Session session = service.getStorageSession();
try
{
if (session.itemExists(usersStorageOld))
{
NodeIterator iterator = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazily();
UserProfileHandlerIm... | java |
private void migrateMemberships() throws Exception
{
Session session = service.getStorageSession();
try
{
if (session.itemExists(usersStorageOld))
{
NodeIterator iterator = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazily();
MembershipHandler... | java |
protected void addBooleanValue(Document doc, String fieldName, Object internalValue)
{
doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.BOOLEAN));
} | java |
protected void addReferenceValue(Document doc, String fieldName, Object internalValue)
{
String uuid = internalValue.toString();
doc.add(createFieldWithoutNorms(fieldName, uuid, PropertyType.REFERENCE));
doc.add(new Field(FieldNames.PROPERTIES, FieldNames.createNamedValue(fieldName, uuid), Field.St... | java |
protected void addPathValue(Document doc, String fieldName, Object pathString)
{
doc.add(createFieldWithoutNorms(fieldName, pathString.toString(), PropertyType.PATH));
} | java |
protected void addNameValue(Document doc, String fieldName, Object internalValue)
{
doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.NAME));
} | java |
protected float getPropertyBoost(InternalQName propertyName)
{
if (indexingConfig == null)
{
return DEFAULT_BOOST;
}
else
{
return indexingConfig.getPropertyBoost(node, propertyName);
}
} | java |
protected void addNodeName(Document doc, String namespaceURI, String localName) throws RepositoryException
{
String name = mappings.getNamespacePrefixByURI(namespaceURI) + ":" + localName;
doc.add(new Field(FieldNames.LABEL, name, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
// as of versio... | java |
protected long writeValue(File file, ValueData value) throws IOException
{
if (value.isByteArray())
{
return writeByteArrayValue(file, value);
}
else
{
return writeStreamedValue(file, value);
}
} | java |
protected long writeByteArrayValue(File file, ValueData value) throws IOException
{
OutputStream out = new FileOutputStream(file);
try
{
byte[] data = value.getAsByteArray();
out.write(data);
return data.length;
}
finally
{
out.clos... | java |
protected long writeStreamedValue(File file, ValueData value) throws IOException
{
long size;
// stream Value
if (value instanceof StreamPersistedValueData)
{
StreamPersistedValueData streamed = (StreamPersistedValueData)value;
if (streamed.isPersisted())
... | java |
protected long writeOutput(OutputStream out, ValueData value) throws IOException
{
if (value.isByteArray())
{
byte[] buff = value.getAsByteArray();
out.write(buff);
return buff.length;
}
else
{
InputStream in;
if (value instanceo... | java |
protected long copy(InputStream in, OutputStream out) throws IOException
{
// compare classes as in Java6 Channels.newChannel(), Java5 has a bug in newChannel().
boolean inFile = in instanceof FileInputStream && FileInputStream.class.equals(in.getClass());
boolean outFile = out instanceof FileO... | java |
protected long copyClose(InputStream in, OutputStream out) throws IOException
{
try
{
try
{
return copy(in, out);
}
finally
{
in.close();
}
}
finally
{
out.close();
}
} | java |
public Response report(Session session, String path, HierarchicalProperty body, Depth depth, String baseURI)
{
try
{
Node node = (Node)session.getItem(path);
WebDavNamespaceContext nsContext = new WebDavNamespaceContext(session);
String strUri = baseURI + node.getPath();
... | java |
protected Set<QName> getProperties(HierarchicalProperty body)
{
HashSet<QName> properties = new HashSet<QName>();
HierarchicalProperty prop = body.getChild(new QName("DAV:", "prop"));
if (prop == null)
{
return properties;
}
for (int i = 0; i < prop.getChildre... | java |
public void write(List<NodeTypeData> nodeTypes, OutputStream os) throws RepositoryException
{
OutputStreamWriter out = new OutputStreamWriter(os);
try
{
for (NodeTypeData nodeType : nodeTypes)
{
printNamespaces(nodeType, out);
printNodeTypeDeclaration(nodeT... | java |
private void printNamespaces(NodeTypeData nodeTypeData, OutputStreamWriter out) throws RepositoryException,
IOException
{
/**
* Using set to store all prefixes found in node types to avoid
* duplication
*/
Set<String> namespaces = new HashSet<String>();
/** Scanning node... | java |
private void printNodeTypeDeclaration(NodeTypeData nodeTypeData, OutputStreamWriter out) throws RepositoryException,
IOException
{
/** Print name */
out.write("[" + qNameToString(nodeTypeData.getName()) + "] ");
/** Print supertypes */
InternalQName[] superTypes = nodeTypeData.getDecla... | java |
private void printPropertyDeclaration(PropertyDefinitionData propertyDefinition, OutputStreamWriter out)
throws IOException, RepositoryException
{
/** Print name */
out.write("\r\n ");
out.write("- " + qNameToString(propertyDefinition.getName()));
out.write(" (" + ExtendedPropertyType.... | java |
private void printChildDeclaration(NodeDefinitionData nodeDefinition, OutputStreamWriter out) throws IOException,
RepositoryException
{
out.write("\r\n ");
out.write("+ " + qNameToString(nodeDefinition.getName()) + " ");
InternalQName[] requiredTypes = nodeDefinition.getRequiredPrimaryTypes... | java |
public float getNodeBoost(NodeData state)
{
IndexingRule rule = getApplicableIndexingRule(state);
if (rule != null)
{
return rule.getNodeBoost();
}
return DEFAULT_BOOST;
} | java |
private PathExpression getCondition(Node config) throws IllegalNameException, RepositoryException
{
Node conditionAttr = config.getAttributes().getNamedItem("condition");
if (conditionAttr == null)
{
return null;
}
String conditionString = conditionAttr.getNodeValue();
in... | java |
public void remove() throws IOException
{
if ((fileBuffer != null) && PrivilegedFileHelper.exists(fileBuffer))
{
if (!PrivilegedFileHelper.delete(fileBuffer))
{
throw new IOException("Cannot remove file " + PrivilegedFileHelper.getAbsolutePath(fileBuffer)
+ " ... | java |
private void swapBuffers() throws IOException
{
byte[] data = ((ByteArrayOutputStream)out).toByteArray();
fileBuffer = PrivilegedFileHelper.createTempFile("decoderBuffer", ".tmp");
PrivilegedFileHelper.deleteOnExit(fileBuffer);
out = new BufferedOutputStream(PrivilegedFileHelper.fileOutputStr... | java |
public void logComment(String message) throws IOException
{
if (reportContext.get() != null)
{
reportContext.get().addComment(message);
}
else
{
writeMessage(message);
}
} | java |
public void logDescription(String description) throws IOException
{
// The ThreadLocal has been initialized so we know that we are in multithreaded mode.
if (reportContext.get() != null)
{
reportContext.get().addComment(description);
}
else
{
writeMessag... | java |
public void logBrokenObjectAndSetInconsistency(String brokenObject) throws IOException
{
setInconsistency();
// The ThreadLocal has been initialized so we know that we are in multithreaded mode.
if (reportContext.get() != null)
{
reportContext.get().addBrokenObject(brokenObject... | java |
public void logExceptionAndSetInconsistency(String message, Throwable e) throws IOException
{
setInconsistency();
// The ThreadLocal has been initialized so we know that we are in multithreaded mode.
if (reportContext.get() != null)
{
reportContext.get().addLogException(message... | java |
private String getIdColumn() throws SQLException
{
try
{
return lockManagerEntry.getParameterValue(ISPNCacheableLockManagerImpl.INFINISPAN_JDBC_CL_ID_COLUMN_NAME);
}
catch (RepositoryConfigurationException e)
{
throw new SQLException(e);
}
} | java |
protected String getTableName() throws SQLException
{
try
{
String dialect = getDialect();
String quote = "\"";
if (dialect.startsWith(DBConstants.DB_DIALECT_MYSQL))
quote = "`";
return quote + lockManagerEntry.getParameterValue(ISPNCacheableLockManagerImpl... | java |
public File getNextFile()
{
File nextFile = null;
try
{
String sNextName = generateName();
nextFile = new File(backupSetDir.getAbsoluteFile() + File.separator + sNextName);
if (isFullBackup && isDirectoryForFullBackup)
{
if (!PrivilegedFi... | java |
private String getStrDate(Calendar c)
{
int m = c.get(Calendar.MONTH) + 1;
int d = c.get(Calendar.DATE);
return "" + c.get(Calendar.YEAR) + (m < 10 ? "0" + m : m) + (d < 10 ? "0" + d : d);
} | java |
private String getStrTime(Calendar c)
{
int h = c.get(Calendar.HOUR);
int m = c.get(Calendar.MINUTE);
int s = c.get(Calendar.SECOND);
return "" + (h < 10 ? "0" + h : h) + (m < 10 ? "0" + m : m) + (s < 10 ? "0" + s : s);
} | java |
void createStructure() throws RepositoryException
{
Session session = getStorageSession();
try
{
Node storage = session.getRootNode().addNode(storagePath.substring(1), STORAGE_NODETYPE);
storage.addNode(STORAGE_JOS_USERS, STORAGE_JOS_USERS_NODETYPE);
storage.addNode(STOR... | java |
Session getStorageSession() throws RepositoryException
{
try
{
ManageableRepository repository = getWorkingRepository();
String workspaceName = storageWorkspace;
if (workspaceName == null)
{
workspaceName = repository.getConfiguration().getDefaultWorkspace... | java |
protected ManageableRepository getWorkingRepository() throws RepositoryException, RepositoryConfigurationException
{
return repositoryName != null ? repositoryService.getRepository(repositoryName) : repositoryService
.getCurrentRepository();
} | java |
public JCRPath createJCRPath(JCRPath parentLoc, String relPath) throws RepositoryException
{
JCRPath addPath = parseNames(relPath, false);
return parentLoc.add(addPath);
} | java |
private boolean isNonspace(String str, char ch) throws RepositoryException
{
if (ch == '|')
{
throw new RepositoryException("Illegal absPath: \"" + str + "\": The path entry contains an illegal char: \"" + ch + "\"");
}
return !((ch == '\t') || (ch == '\n') || (ch == '\f') || (ch ==... | java |
public boolean isAbsolute()
{
if (names[0].getIndex() == 1 && names[0].getName().length() == 0 && names[0].getNamespace().length() == 0)
return true;
else
return false;
} | java |
public QPathEntry[] getRelPath(int relativeDegree) throws IllegalPathException
{
int len = getLength() - relativeDegree;
if (len < 0)
throw new IllegalPathException("Relative degree " + relativeDegree + " is more than depth for "
+ getAsString());
QPathEntry[] relPath = new Q... | java |
public static QPath getCommonAncestorPath(QPath firstPath, QPath secondPath) throws PathNotFoundException
{
if (!firstPath.getEntries()[0].equals(secondPath.getEntries()[0]))
{
throw new PathNotFoundException("For the given ways there is no common ancestor.");
}
List<QPathEntry> ca... | java |
public String getAsString()
{
if (stringName == null)
{
StringBuilder str = new StringBuilder();
for (int i = 0; i < getLength(); i++)
{
str.append(names[i].getAsString(true));
}
stringName = str.toString();
}
return stringName;
} | java |
public static QPath parse(String qPath) throws IllegalPathException
{
if (qPath == null)
throw new IllegalPathException("Bad internal path '" + qPath + "'");
if (qPath.length() < 2 || !qPath.startsWith("[]"))
throw new IllegalPathException("Bad internal path '" + qPath + "'");
i... | java |
void repair(boolean ignoreFailure) throws IOException
{
if (errors.size() == 0)
{
log.info("No errors found.");
return;
}
int notRepairable = 0;
for (Iterator<ConsistencyCheckError> it = errors.iterator(); it.hasNext();)
{
final ConsistencyCheckError err... | java |
private void run() throws IOException, RepositoryException
{
// UUIDs of multiple nodes in the index
Set<String> multipleEntries = new HashSet<String>();
// collect all documents UUIDs
documentUUIDs = new HashSet<String>();
CachingMultiIndexReader reader = index.getIndexReader();
... | java |
public WorkspaceContainer getWorkspaceContainer(String workspaceName)
{
Object comp = getComponentInstance(workspaceName);
return comp != null && comp instanceof WorkspaceContainer ? (WorkspaceContainer)comp : null;
} | java |
public WorkspaceEntry getWorkspaceEntry(String wsName)
{
for (WorkspaceEntry entry : config.getWorkspaceEntries())
{
if (entry.getName().equals(wsName))
return entry;
}
return null;
} | java |
private void load() throws RepositoryException
{
//Namespaces first
NamespaceDataPersister namespacePersister =
(NamespaceDataPersister)this.getComponentInstanceOfType(NamespaceDataPersister.class);
NamespaceRegistryImpl nsRegistry = (NamespaceRegistryImpl)getNamespaceRegistry();
na... | java |
protected InternalQName[] getSelectProperties() throws RepositoryException
{
// get select properties
List<InternalQName> selectProps = new ArrayList<InternalQName>();
selectProps.addAll(Arrays.asList(root.getSelectProperties()));
if (selectProps.size() == 0)
{
// use node type... | java |
protected Session session(String repoName, String wsName, List<String> lockTokens) throws Exception,
NoSuchWorkspaceException
{
// To be cloud compliant we need now to ignore the provided repository name (more details in JCR-2138)
ManageableRepository repo = repositoryService.getCurrentReposito... | java |
protected String getRepositoryName(String repoName) throws RepositoryException
{
// To be cloud compliant we need now to ignore the provided repository name (more details in JCR-2138)
ManageableRepository repo = repositoryService.getCurrentRepository();
String currentRepositoryName = repo.getCo... | java |
protected String normalizePath(String repoPath)
{
if (repoPath.length() > 0 && repoPath.endsWith("/"))
{
return repoPath.substring(0, repoPath.length() - 1);
}
return repoPath;
} | java |
protected String path(String repoPath, boolean withIndex)
{
String path = repoPath.substring(workspaceName(repoPath).length());
if (path.length() > 0)
{
if (!withIndex)
{
return TextUtil.removeIndexFromPath(path);
}
return path;
}
... | java |
protected List<String> lockTokens(String lockTokenHeader, String ifHeader)
{
ArrayList<String> lockTokens = new ArrayList<String>();
if (lockTokenHeader != null)
{
if (lockTokenHeader.startsWith("<"))
{
lockTokenHeader = lockTokenHeader.substring(1, lockTokenH... | java |
private URI buildURI(String path) throws URISyntaxException
{
try
{
return new URI(path);
}
catch (URISyntaxException e)
{
return new URI(TextUtil.escape(path, '%', true));
}
} | java |
private boolean isAllowedPath(String workspaceName, String path)
{
if(pattern == null)
return true;
Matcher matcher= pattern.matcher(workspaceName+":"+path);
if(!matcher.find())
{
log.warn("Access not allowed to webdav resource {}",path);
return false;
... | java |
protected void createRepositoryInternally(String backupId, RepositoryEntry rEntry, String rToken,
DBCreationProperties creationProps) throws RepositoryConfigurationException, RepositoryCreationException
{
if (rpcService != null)
{
String stringRepositoryEntry = null;
try
... | java |
protected void removeRepositoryLocally(String repositoryName, boolean forceRemove) throws RepositoryCreationException
{
try
{
// extract list of all datasources
ManageableRepository repositorty = repositoryService.getRepository(repositoryName);
Set<String> datasources = e... | java |
private void traverseResources(Resource resource, int counter) throws XMLStreamException, RepositoryException,
IllegalResourceTypeException, URISyntaxException, UnsupportedEncodingException
{
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "h... | java |
private void calculateWorkspaceDataSize()
{
long dataSize;
try
{
dataSize = getWorkspaceDataSizeDirectly();
}
catch (QuotaManagerException e1)
{
throw new IllegalStateException("Can't calculate workspace data size", e1);
}
ChangesItem changesItem = n... | java |
private void printWarning(PropertyImpl property, Exception exception) throws RepositoryException
{
if (PropertyManager.isDevelopping())
{
LOG.warn("Binary value reader error, content by path " + property.getPath() + ", property id "
+ property.getData().getIdentifier() + " : " + exce... | java |
private void setJCRProperties(NodeImpl parent, Properties props) throws Exception
{
if (!parent.isNodeType("dc:elementSet"))
{
parent.addMixin("dc:elementSet");
}
ValueFactory vFactory = parent.getSession().getValueFactory();
LocationFactory lFactory = parent.getSession().getL... | java |
private static String prepareScripts(String initScriptPath, String itemTableSuffix, String valueTableSuffix,
String refTableSuffix, boolean isolatedDB) throws IOException
{
String scripts = IOUtil.getStreamContentAsString(PrivilegedFileHelper.getResourceAsStream(initScriptPath));
if (isolatedDB)
... | java |
public static String scriptPath(String dbDialect, boolean multiDb)
{
String suffix = multiDb ? "m" : "s";
String sqlPath = null;
if (dbDialect.startsWith(DBConstants.DB_DIALECT_ORACLE))
{
sqlPath = "/conf/storage/jcr-" + suffix + "jdbc.ora.sql";
}
else if (dbDialect.star... | java |
public static String getRootNodeInitializeScript(String itemTableName, boolean multiDb)
{
String singeDbScript =
"insert into " + itemTableName + "(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, "
+ "N_ORDER_NUM) VALUES('" + Constants.ROOT_PARENT_UUID + "', '" + Constants.... | java |
public static String getObjectScript(String objectName, boolean multiDb, String dialect, WorkspaceEntry wsEntry)
throws RepositoryConfigurationException, IOException
{
String scripts = prepareScripts(wsEntry, dialect);
String sql = null;
for (String query : JDBCUtils.splitWithSQLDelimiter(sc... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.