You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2016/12/12 12:03:43 UTC
svn commit: r1773777 [1/2] - in /jackrabbit/branches/2.12: ./
jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/
jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/
jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav...
Author: reschke
Date: Mon Dec 12 12:03:43 2016
New Revision: 1773777
URL: http://svn.apache.org/viewvc?rev=1773777&view=rev
Log:
JCR-4064: Refactor WebDAV related code out of HttpClient3-specific classes for better future re-use (ported to 2.12)
Added:
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/PropfindInfo.java
- copied unchanged from r1771999, jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/PropfindInfo.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/ProppatchInfo.java
- copied unchanged from r1772049, jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/ProppatchInfo.java
Modified:
jackrabbit/branches/2.12/ (props changed)
jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/AclMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/BaselineControlMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckinMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckoutMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CopyMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DeleteMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/LabelMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MergeMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkActivityMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkColMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkWorkspaceMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MoveMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OptionsMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OrderPatchMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PropFindMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PropPatchMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PutMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/ReportMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/SearchMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/UnLockMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/UnSubscribeMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/UncheckoutMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/UpdateMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/VersionControlMethod.java
jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/EventDiscovery.java
Propchange: jackrabbit/branches/2.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 12 12:03:43 2016
@@ -1,3 +1,3 @@
/jackrabbit/branches/JCR-2272:1173165-1176545
/jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1732436,1751279,1752165,1753226,1758600,1759607,1759782,1759865,1761679,1761909,1762422,1763558,1766398,1768684,1771078,1771741,1772299,1772597,1772822,1773591
+/jackrabbit/trunk:1732436,1751279,1752165,1753226,1758600,1759607,1759782,1759865,1761679,1761909,1762422,1763558,1766398,1768684,1771078,1771741,1771939,1771999,1772049,1772299,1772444,1772457,1772530,1772544,1772597,1772822,1773591
Modified: jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java Mon Dec 12 12:03:43 2016
@@ -43,23 +43,14 @@ import javax.jcr.Credentials;
import javax.jcr.InvalidItemStateException;
import javax.jcr.ItemNotFoundException;
import javax.jcr.LoginException;
-import javax.jcr.MergeException;
import javax.jcr.NamespaceException;
-import javax.jcr.NoSuchWorkspaceException;
import javax.jcr.PathNotFoundException;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.UnsupportedRepositoryOperationException;
import javax.jcr.Value;
import javax.jcr.ValueFactory;
-import javax.jcr.ValueFormatException;
import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.InvalidNodeTypeDefinitionException;
-import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.nodetype.NodeTypeExistsException;
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.version.VersionException;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.httpclient.Header;
@@ -281,7 +272,7 @@ public class RepositoryServiceImpl imple
* Same as {@link #RepositoryServiceImpl(String, IdFactory, NameFactory, PathFactory, QValueFactory, int, int)}
* using {@link #MAX_CONNECTIONS_DEFAULT} for the maximum number of
* connections on the client.
- *
+ *
* @param uri The server uri.
* @param idFactory The id factory.
* @param nameFactory The name factory.
@@ -405,7 +396,7 @@ public class RepositoryServiceImpl imple
method.setRequestHeader(ifH.getHeaderName(), ifH.getHeaderValue());
}
}
-
+
initMethod(method, sessionInfo);
}
@@ -655,38 +646,33 @@ public class RepositoryServiceImpl imple
}
//--------------------------------------------------< RepositoryService >---
- /**
- * @see RepositoryService#getIdFactory()
- */
+
+ @Override
public IdFactory getIdFactory() {
return idFactory;
}
- /**
- * @see RepositoryService#getNameFactory()
- */
+ @Override
public NameFactory getNameFactory() {
return nameFactory;
}
- /**
- * @see RepositoryService#getPathFactory()
- */
+ @Override
public PathFactory getPathFactory() {
return pathFactory;
}
+ @Override
public QValueFactory getQValueFactory() {
return qValueFactory;
}
+ @Override
public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) throws RepositoryException {
return new ItemInfoCacheImpl(itemInfoCacheSize);
}
- /**
- * @see RepositoryService#getRepositoryDescriptors()
- */
+ @Override
public Map<String, QValue[]> getRepositoryDescriptors() throws RepositoryException {
if (descriptors.isEmpty()) {
ReportInfo info = new ReportInfo(JcrRemotingConstants.REPORT_REPOSITORY_DESCRIPTORS, ItemResourceConstants.NAMESPACE);
@@ -743,27 +729,27 @@ public class RepositoryServiceImpl imple
return descriptors;
}
- /**
- * @see RepositoryService#obtain(Credentials, String)
- */
+ @Override
public SessionInfo obtain(Credentials credentials, String workspaceName)
- throws LoginException, NoSuchWorkspaceException, RepositoryException {
+ throws RepositoryException {
CredentialsWrapper dc = new CredentialsWrapper(credentials);
return obtain(dc, workspaceName);
}
+ @Override
public SessionInfo obtain(SessionInfo sessionInfo, String workspaceName)
- throws LoginException, NoSuchWorkspaceException, RepositoryException {
+ throws RepositoryException {
checkSessionInfo(sessionInfo);
return obtain(((SessionInfoImpl)sessionInfo).getCredentials(), workspaceName);
}
- public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws LoginException, RepositoryException {
+ @Override
+ public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws RepositoryException {
throw new UnsupportedOperationException("Not implemented yet.");
}
private SessionInfo obtain(CredentialsWrapper credentials, String workspaceName)
- throws LoginException, NoSuchWorkspaceException, RepositoryException {
+ throws RepositoryException {
// check if the workspace with the given name is accessible
PropFindMethod method = null;
SessionInfoImpl sessionInfo = new SessionInfoImpl(credentials, workspaceName);
@@ -827,14 +813,13 @@ public class RepositoryServiceImpl imple
return sessionInfo;
}
+ @Override
public void dispose(SessionInfo sessionInfo) throws RepositoryException {
checkSessionInfo(sessionInfo);
removeClient(sessionInfo);
}
- /**
- * @see RepositoryService#getWorkspaceNames(SessionInfo)
- */
+ @Override
public String[] getWorkspaceNames(SessionInfo sessionInfo) throws RepositoryException {
DavPropertyNameSet nameSet = new DavPropertyNameSet();
nameSet.add(DeltaVConstants.WORKSPACE);
@@ -865,9 +850,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#isGranted(SessionInfo, ItemId, String[] actions)
- */
+ @Override
public boolean isGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions) throws RepositoryException {
ReportMethod method = null;
try {
@@ -962,7 +945,7 @@ public class RepositoryServiceImpl imple
}
}
}
-
+
private PrivilegeDefinition[] internalGetPrivilegeDefinitions(SessionInfo sessionInfo, String uri) throws RepositoryException {
DavPropertyNameSet nameSet = new DavPropertyNameSet();
nameSet.add(SecurityConstants.SUPPORTED_PRIVILEGE_SET);
@@ -993,7 +976,7 @@ public class RepositoryServiceImpl imple
if (aggregates != null && aggregates.length > 0) {
aggrnames = new HashSet<Name>();
for (SupportedPrivilege aggregate : aggregates) {
- Name aggregateName = nameFactory.create(aggregate.getPrivilege().getNamespace().getURI(),
+ Name aggregateName = nameFactory.create(aggregate.getPrivilege().getNamespace().getURI(),
aggregate.getPrivilege().getName());
aggrnames.add(aggregateName);
}
@@ -1026,16 +1009,12 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getNodeDefinition(SessionInfo, NodeId)
- */
+ @Override
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
return (QNodeDefinition) getItemDefinition(sessionInfo, nodeId);
}
- /**
- * @see RepositoryService#getPropertyDefinition(SessionInfo, PropertyId)
- */
+ @Override
public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException {
return (QPropertyDefinition) getItemDefinition(sessionInfo, propertyId);
}
@@ -1105,9 +1084,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getNodeInfo(SessionInfo, NodeId)
- */
+ @Override
public NodeInfo getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
// set of properties to be retrieved
DavPropertyNameSet nameSet = new DavPropertyNameSet();
@@ -1185,9 +1162,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getItemInfos(SessionInfo, ItemId)
- */
+ @Override
public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException {
// TODO: implement batch read properly:
// currently: missing 'value/values' property PropertyInfo cannot be built
@@ -1210,7 +1185,7 @@ public class RepositoryServiceImpl imple
private NodeInfoImpl buildNodeInfo(String baseUri, MultiStatusResponse nodeResponse,
NodeId parentId, DavPropertySet propSet,
SessionInfo sessionInfo,
- NamePathResolver resolver) throws NameException, RepositoryException {
+ NamePathResolver resolver) throws RepositoryException {
NodeId id = uriResolver.buildNodeId(parentId, baseUri, nodeResponse, sessionInfo.getWorkspaceName(), getNamePathResolver(sessionInfo));
NodeInfoImpl nInfo = new NodeInfoImpl(id, propSet, resolver);
DavProperty p = propSet.get(JcrRemotingConstants.JCR_REFERENCES_LN, ItemResourceConstants.NAMESPACE);
@@ -1259,9 +1234,7 @@ public class RepositoryServiceImpl imple
return l;
}
- /**
- * @see RepositoryService#getChildInfos(SessionInfo, NodeId)
- */
+ @Override
public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId) throws RepositoryException {
// set of properties to be retrieved
DavPropertyNameSet nameSet = new DavPropertyNameSet();
@@ -1318,15 +1291,13 @@ public class RepositoryServiceImpl imple
return new ChildInfoImpl(qName, uuid, index);
}
- /**
- * @see RepositoryService#getReferences(SessionInfo, NodeId, Name, boolean)
- */
- public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) throws ItemNotFoundException, RepositoryException {
+ @Override
+ public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) throws RepositoryException {
// set of properties to be retrieved
DavPropertyNameSet nameSet = new DavPropertyNameSet();
String refType = weakReferences ? JcrRemotingConstants.JCR_WEAK_REFERENCES_LN : JcrRemotingConstants.JCR_REFERENCES_LN;
nameSet.add(refType, ItemResourceConstants.NAMESPACE);
-
+
DavMethodBase method = null;
try {
String uri = getItemUri(nodeId, sessionInfo);
@@ -1369,9 +1340,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getPropertyInfo(SessionInfo, PropertyId)
- */
+ @Override
public PropertyInfo getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException {
GetMethod method = null;
try {
@@ -1399,7 +1368,7 @@ public class RepositoryServiceImpl imple
NamePathResolver resolver = getNamePathResolver(sessionInfo);
if (ct.startsWith("jcr-value")) {
- type = JcrValueType.typeFromContentType(ct);
+ type = JcrValueType.typeFromContentType(ct);
QValue v;
if (type == PropertyType.BINARY) {
v = getQValueFactory().create(method.getResponseBodyAsStream());
@@ -1429,7 +1398,6 @@ public class RepositoryServiceImpl imple
}
return new PropertyInfoImpl(propertyId, path, type, isMultiValued, values);
-
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException e) {
@@ -1509,17 +1477,13 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#createBatch(SessionInfo,ItemId)
- */
+ @Override
public Batch createBatch(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException {
checkSessionInfo(sessionInfo);
return new BatchImpl(itemId, sessionInfo);
}
- /**
- * @see RepositoryService#submit(Batch)
- */
+ @Override
public void submit(Batch batch) throws RepositoryException {
if (!(batch instanceof BatchImpl)) {
throw new RepositoryException("Unknown Batch implementation.");
@@ -1566,9 +1530,7 @@ public class RepositoryServiceImpl imple
return new DocumentTree(nodeName, primaryTypeName, uniqueId, getNamePathResolver(sessionInfo));
}
- /**
- * @see RepositoryService#importXml(SessionInfo, NodeId, InputStream, int)
- */
+ @Override
public void importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) throws RepositoryException {
// TODO: improve. currently random name is built instead of retrieving name of new resource from top-level xml element within stream
Name nodeName = getNameFactory().create(Name.NS_DEFAULT_URI, UUID.randomUUID().toString());
@@ -1579,9 +1541,7 @@ public class RepositoryServiceImpl imple
execute(method, sessionInfo);
}
- /**
- * @see RepositoryService#move(SessionInfo, NodeId, NodeId, Name)
- */
+ @Override
public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException {
String uri = getItemUri(srcNodeId, sessionInfo);
String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
@@ -1594,9 +1554,7 @@ public class RepositoryServiceImpl imple
clearItemUriCache(sessionInfo);
}
- /**
- * @see RepositoryService#copy(SessionInfo, String, NodeId, NodeId, Name)
- */
+ @Override
public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException {
String uri = uriResolver.getItemUri(srcNodeId, srcWorkspaceName, sessionInfo);
String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
@@ -1607,9 +1565,7 @@ public class RepositoryServiceImpl imple
execute(method, sessionInfo);
}
- /**
- * @see RepositoryService#update(SessionInfo, NodeId, String)
- */
+ @Override
public void update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) throws RepositoryException {
String uri = getItemUri(nodeId, sessionInfo);
String workspUri = uriResolver.getWorkspaceUri(srcWorkspaceName);
@@ -1617,17 +1573,13 @@ public class RepositoryServiceImpl imple
update(uri, null, new String[] {workspUri}, UpdateInfo.UPDATE_BY_WORKSPACE, false, sessionInfo);
}
- /**
- * @see RepositoryService#clone(SessionInfo, String, NodeId, NodeId, Name, boolean)
- */
+ @Override
public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) throws RepositoryException {
// TODO: missing implementation
throw new UnsupportedOperationException("Missing implementation");
}
- /**
- * @see RepositoryService#getLockInfo(SessionInfo, NodeId)
- */
+ @Override
public LockInfo getLockInfo(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
// set of Dav-properties to be retrieved
DavPropertyNameSet nameSet = new DavPropertyNameSet();
@@ -1672,18 +1624,14 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#lock(SessionInfo, NodeId, boolean, boolean)
- */
+ @Override
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep,
boolean sessionScoped) throws RepositoryException {
return lock(sessionInfo, nodeId, deep, sessionScoped, Long.MAX_VALUE, null);
}
- /**
- * @see RepositoryService#lock(SessionInfo, NodeId, boolean, boolean, long, String)
- */
- public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException {
+ @Override
+ public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) throws RepositoryException {
try {
checkSessionInfo(sessionInfo);
long davTimeout = (timeoutHint == Long.MAX_VALUE) ? INFINITE_TIMEOUT : timeoutHint*1000;
@@ -1706,9 +1654,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#refreshLock(SessionInfo, NodeId)
- */
+ @Override
public void refreshLock(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
checkSessionInfo(sessionInfo);
String uri = getItemUri(nodeId, sessionInfo);
@@ -1720,9 +1666,7 @@ public class RepositoryServiceImpl imple
execute(method, sessionInfo);
}
- /**
- * @see RepositoryService#unlock(SessionInfo, NodeId)
- */
+ @Override
public void unlock(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
checkSessionInfo(sessionInfo);
String uri = getItemUri(nodeId, sessionInfo);
@@ -1783,10 +1727,8 @@ public class RepositoryServiceImpl imple
return new LockInfoImpl(activeLock, holder == null ? nodeId : holder, ((SessionInfoImpl)sessionInfo).getAllLockTokens());
}
- /**
- * @see RepositoryService#checkin(SessionInfo, NodeId)
- */
- public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException {
+ @Override
+ public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
String uri = getItemUri(nodeId, sessionInfo);
CheckinMethod method = new CheckinMethod(uri);
execute(method, sessionInfo);
@@ -1794,19 +1736,15 @@ public class RepositoryServiceImpl imple
return uriResolver.getNodeId(resolve(uri, rh.getValue()), sessionInfo);
}
- /**
- * @see RepositoryService#checkout(SessionInfo, NodeId)
- */
- public void checkout(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException {
+ @Override
+ public void checkout(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
String uri = getItemUri(nodeId, sessionInfo);
CheckoutMethod method = new CheckoutMethod(uri);
execute(method, sessionInfo);
}
- /**
- * @see RepositoryService#checkout(SessionInfo, NodeId, NodeId)
- */
- public void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException {
+ @Override
+ public void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws RepositoryException {
if (activityId == null) {
checkout(sessionInfo, nodeId);
} else {
@@ -1815,20 +1753,16 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#checkpoint(SessionInfo, NodeId)
- */
- public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
// TODO review again.
NodeId vID = checkin(sessionInfo, nodeId);
checkout(sessionInfo, nodeId);
return vID;
}
- /**
- * @see RepositoryService#checkpoint(SessionInfo, NodeId, NodeId)
- */
- public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws RepositoryException {
if (activityId == null) {
return checkpoint(sessionInfo, nodeId);
} else {
@@ -1837,18 +1771,14 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#removeVersion(SessionInfo, NodeId, NodeId)
- */
+ @Override
public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws RepositoryException {
String uri = getItemUri(versionId, sessionInfo);
DeleteMethod method = new DeleteMethod(uri);
execute(method, sessionInfo);
}
- /**
- * @see RepositoryService#restore(SessionInfo, NodeId, NodeId, boolean)
- */
+ @Override
public void restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting) throws RepositoryException {
String uri = getItemUri(nodeId, sessionInfo);
String vUri = getItemUri(versionId, sessionInfo);
@@ -1896,9 +1826,7 @@ public class RepositoryServiceImpl imple
}
- /**
- * @see RepositoryService#restore(SessionInfo, NodeId[], boolean)
- */
+ @Override
public void restore(SessionInfo sessionInfo, NodeId[] versionIds, boolean removeExisting) throws RepositoryException {
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
String[] vUris = new String[versionIds.length];
@@ -1938,17 +1866,13 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#merge(SessionInfo, NodeId, String, boolean)
- */
- public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException {
+ @Override
+ public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws RepositoryException {
return merge(sessionInfo, nodeId, srcWorkspaceName, bestEffort, false);
}
- /**
- * @see RepositoryService#merge(SessionInfo, NodeId, String, boolean, boolean)
- */
- public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException {
+ @Override
+ public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws RepositoryException {
try {
Document doc = DomUtil.createDocument();
String wspHref = obtainAbsolutePathFromUri(uriResolver.getWorkspaceUri(srcWorkspaceName));
@@ -1978,10 +1902,8 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#resolveMergeConflict(SessionInfo, NodeId, NodeId[], NodeId[])
- */
- public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws RepositoryException {
try {
List<HrefProperty> changeList = new ArrayList<HrefProperty>();
String[] mergeFailedHref = new String[mergeFailedIds.length];
@@ -2005,10 +1927,8 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#addVersionLabel(SessionInfo,NodeId,NodeId,Name,boolean)
- */
- public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws VersionException, RepositoryException {
+ @Override
+ public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws RepositoryException {
try {
String uri = getItemUri(versionId, sessionInfo);
String strLabel = getNamePathResolver(sessionInfo).getJCRName(label);
@@ -2019,10 +1939,8 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#removeVersionLabel(SessionInfo,NodeId,NodeId,Name)
- */
- public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws VersionException, RepositoryException {
+ @Override
+ public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws RepositoryException {
try {
String uri = getItemUri(versionId, sessionInfo);
String strLabel = getNamePathResolver(sessionInfo).getJCRName(label);
@@ -2033,41 +1951,31 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#createActivity(SessionInfo, String)
- */
- public NodeId createActivity(SessionInfo sessionInfo, String title) throws UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public NodeId createActivity(SessionInfo sessionInfo, String title) throws RepositoryException {
// TODO
throw new UnsupportedOperationException("JCR-2104: JSR 283 Versioning. Implementation missing");
}
- /**
- * @see RepositoryService#removeActivity(SessionInfo, NodeId)
- */
- public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws RepositoryException {
// TODO
throw new UnsupportedOperationException("JCR-2104: JSR 283 Versioning. Implementation missing");
}
- /**
- * @see RepositoryService#mergeActivity(SessionInfo, NodeId)
- */
- public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws RepositoryException {
// TODO
throw new UnsupportedOperationException("JCR-2104: JSR 283 Versioning. Implementation missing");
}
- /**
- * @see RepositoryService#createConfiguration(SessionInfo, NodeId)
- */
- public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
// TODO
throw new UnsupportedOperationException("JCR-2104: JSR 283 Versioning. Implementation missing");
}
- /**
- * @see RepositoryService#getSupportedQueryLanguages(SessionInfo)
- */
+ @Override
public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException {
OptionsMethod method = new OptionsMethod(uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName()));
try {
@@ -2086,18 +1994,17 @@ public class RepositoryServiceImpl imple
}
}
+ @Override
public String[] checkQueryStatement(SessionInfo sessionInfo,
String statement,
String language,
Map<String, String> namespaces)
- throws InvalidQueryException, RepositoryException {
+ throws RepositoryException {
// TODO implement
return new String[0];
}
- /**
- * @see RepositoryService#executeQuery(SessionInfo, String, String,java.util.Map,long,long,java.util.Map
- */
+ @Override
public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces, long limit, long offset, Map<String, QValue> values) throws RepositoryException {
SearchMethod method = null;
try {
@@ -2135,9 +2042,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#createEventFilter(SessionInfo, int, Path, boolean, String[], Name[], boolean)
- */
+ @Override
public EventFilter createEventFilter(SessionInfo sessionInfo,
int eventTypes,
Path absPath,
@@ -2145,7 +2050,7 @@ public class RepositoryServiceImpl imple
String[] uuids,
Name[] nodeTypeNames,
boolean noLocal)
- throws UnsupportedRepositoryOperationException, RepositoryException {
+ throws RepositoryException {
// resolve node type names
// todo what if new node types become available while event filter is still in use?
Set<Name> resolvedTypeNames = null;
@@ -2165,11 +2070,9 @@ public class RepositoryServiceImpl imple
resolvedTypeNames, noLocal);
}
- /**
- * @see RepositoryService#getEvents(Subscription, long)
- */
+ @Override
public EventBundle[] getEvents(Subscription subscription, long timeout)
- throws RepositoryException, UnsupportedRepositoryOperationException {
+ throws RepositoryException {
checkSubscription(subscription);
EventSubscriptionImpl subscr = (EventSubscriptionImpl) subscription;
@@ -2178,11 +2081,8 @@ public class RepositoryServiceImpl imple
return poll(rootUri, subscr.getId(), timeout, subscr.getSessionInfo());
}
- /**
- * @see RepositoryService#getEvents(SessionInfo, EventFilter, long)
- */
- public EventBundle getEvents(SessionInfo sessionInfo, EventFilter filter, long after) throws RepositoryException,
- UnsupportedRepositoryOperationException {
+ @Override
+ public EventBundle getEvents(SessionInfo sessionInfo, EventFilter filter, long after) throws RepositoryException {
// TODO: use filters remotely (JCR-3179)
GetMethod method = null;
@@ -2241,12 +2141,10 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#createSubscription(SessionInfo, EventFilter[])
- */
+ @Override
public Subscription createSubscription(SessionInfo sessionInfo,
EventFilter[] filters)
- throws UnsupportedRepositoryOperationException, RepositoryException {
+ throws RepositoryException {
checkSessionInfo(sessionInfo);
String rootUri = uriResolver.getRootItemUri(sessionInfo.getWorkspaceName());
@@ -2263,9 +2161,7 @@ public class RepositoryServiceImpl imple
return new EventSubscriptionImpl(subscriptionId, (SessionInfoImpl) sessionInfo);
}
- /**
- * @see RepositoryService#updateEventFilters(Subscription, EventFilter[])
- */
+ @Override
public void updateEventFilters(Subscription subscription,
EventFilter[] filters)
throws RepositoryException {
@@ -2293,6 +2189,7 @@ public class RepositoryServiceImpl imple
}
}
+ @Override
public void dispose(Subscription subscription) throws RepositoryException {
checkSubscription(subscription);
EventSubscriptionImpl subscr = (EventSubscriptionImpl) subscription;
@@ -2416,7 +2313,7 @@ public class RepositoryServiceImpl imple
}
private List<Event> buildEventList(Element bundleElement, SessionInfoImpl sessionInfo, String baseUri)
- throws IllegalNameException, NamespaceException, RepositoryException {
+ throws RepositoryException {
List<Event> events = new ArrayList<Event>();
ElementIterator eventElementIterator = DomUtil.getChildren(bundleElement, ObservationConstants.N_EVENT);
@@ -2490,7 +2387,6 @@ public class RepositoryServiceImpl imple
} catch (RepositoryException e) {
log.warn("Unable to build event parentId: {}", e.getMessage());
}
-
}
if (userId == null) {
@@ -2505,9 +2401,7 @@ public class RepositoryServiceImpl imple
return events;
}
- /**
- * @see RepositoryService#getRegisteredNamespaces(SessionInfo)
- */
+ @Override
public Map<String, String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException {
ReportInfo info = new ReportInfo(JcrRemotingConstants.REPORT_REGISTERED_NAMESPACES, ItemResourceConstants.NAMESPACE);
ReportMethod method = null;
@@ -2551,11 +2445,9 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getNamespaceURI(SessionInfo, String)
- */
+ @Override
public String getNamespaceURI(SessionInfo sessionInfo, String prefix)
- throws NamespaceException, RepositoryException {
+ throws RepositoryException {
try {
return nsCache.getURI(prefix);
} catch (NamespaceException e) {
@@ -2565,11 +2457,9 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getNamespacePrefix(SessionInfo, String)
- */
+ @Override
public String getNamespacePrefix(SessionInfo sessionInfo, String uri)
- throws NamespaceException, RepositoryException {
+ throws RepositoryException {
try {
return nsCache.getPrefix(uri);
} catch (NamespaceException e) {
@@ -2579,10 +2469,8 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#registerNamespace(SessionInfo, String, String)
- */
- public void registerNamespace(SessionInfo sessionInfo, String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException {
+ @Override
+ public void registerNamespace(SessionInfo sessionInfo, String prefix, String uri) throws RepositoryException {
// make sure we have them all
getRegisteredNamespaces(sessionInfo);
@@ -2596,10 +2484,8 @@ public class RepositoryServiceImpl imple
nsCache.add(prefix, uri);
}
- /**
- * @see RepositoryService#unregisterNamespace(SessionInfo, String)
- */
- public void unregisterNamespace(SessionInfo sessionInfo, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException {
+ @Override
+ public void unregisterNamespace(SessionInfo sessionInfo, String uri) throws RepositoryException {
// make sure we have them all
getRegisteredNamespaces(sessionInfo);
@@ -2622,7 +2508,7 @@ public class RepositoryServiceImpl imple
* @throws AccessDeniedException
* @throws RepositoryException
*/
- private void internalSetNamespaces(SessionInfo sessionInfo, Map<String, String> namespaces) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException {
+ private void internalSetNamespaces(SessionInfo sessionInfo, Map<String, String> namespaces) throws RepositoryException {
DavPropertySet setProperties = new DavPropertySet();
setProperties.add(createNamespaceProperty(namespaces));
@@ -2646,10 +2532,8 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @see RepositoryService#getQNodeTypeDefinitions(SessionInfo)
- */
- public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException {
+ @Override
+ public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException {
ReportMethod method = null;
try {
ReportInfo info = new ReportInfo(JcrRemotingConstants.REPORT_NODETYPES, ItemResourceConstants.NAMESPACE);
@@ -2675,21 +2559,17 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * {@inheritDoc}
- */
+ @Override
public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException {
// in order to avoid individual calls for every nodetype, retrieve
// the complete set from the server (again).
return getQNodeTypeDefinitions(sessionInfo);
}
- /**
- * {@inheritDoc}
- */
- public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException {
+ @Override
+ public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws RepositoryException {
PropPatchMethod method = null;
- try {
+ try {
DavPropertySet setProperties = new DavPropertySet();
setProperties.add(createRegisterNodeTypesProperty(sessionInfo, nodeTypeDefinitions, allowUpdate));
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
@@ -2708,12 +2588,10 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * {@inheritDoc}
- */
- public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException {
+ @Override
+ public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws RepositoryException {
PropPatchMethod method = null;
- try {
+ try {
DavPropertySet setProperties = new DavPropertySet();
setProperties.add(createUnRegisterNodeTypesProperty(sessionInfo, nodeTypeNames));
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
@@ -2732,16 +2610,14 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * {@inheritDoc}
- */
- public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException {
+ @Override
+ public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws RepositoryException {
if (srcWorkspaceName != null) {
throw new UnsupportedOperationException("JCR-2003. Implementation missing");
}
MkWorkspaceMethod method = null;
- try {
+ try {
method = new MkWorkspaceMethod(uriResolver.getWorkspaceUri(name));
initMethod(method, sessionInfo, true);
getClient(sessionInfo).executeMethod(method);
@@ -2757,12 +2633,10 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * {@inheritDoc}
- */
- public void deleteWorkspace(SessionInfo sessionInfo, String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException {
+ @Override
+ public void deleteWorkspace(SessionInfo sessionInfo, String name) throws RepositoryException {
DeleteMethod method = null;
- try {
+ try {
method = new DeleteMethod(uriResolver.getWorkspaceUri(name));
initMethod(method, sessionInfo, true);
getClient(sessionInfo).executeMethod(method);
@@ -3146,7 +3020,7 @@ public class RepositoryServiceImpl imple
}
@Override
- public void setValue(PropertyId propertyId, QValue value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
+ public void setValue(PropertyId propertyId, QValue value) throws RepositoryException {
checkConsumed();
if (value == null) {
// setting property value to 'null' is identical to a removal
@@ -3164,7 +3038,7 @@ public class RepositoryServiceImpl imple
}
@Override
- public void setValue(PropertyId propertyId, QValue[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
+ public void setValue(PropertyId propertyId, QValue[] values) throws RepositoryException {
checkConsumed();
if (values == null) {
// setting property value to 'null' is identical to a removal
@@ -3254,7 +3128,7 @@ public class RepositoryServiceImpl imple
}
@Override
- public void setMixins(NodeId nodeId, Name[] mixinNodeTypeIds) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
+ public void setMixins(NodeId nodeId, Name[] mixinNodeTypeIds) throws RepositoryException {
checkConsumed();
try {
DavPropertySet setProperties;
@@ -3353,9 +3227,7 @@ public class RepositoryServiceImpl imple
this.sessionInfo = sessionInfo;
}
- /**
- * @inheritDoc
- */
+ @Override
public String getURI(String prefix) throws NamespaceException {
try {
return getNamespaceURI(sessionInfo, prefix);
@@ -3365,9 +3237,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @inheritDoc
- */
+ @Override
public String getPrefix(String uri) throws NamespaceException {
try {
return getNamespacePrefix(sessionInfo, uri);
@@ -3396,9 +3266,7 @@ public class RepositoryServiceImpl imple
return ((SessionInfoImpl) sessionInfo).getNamePathResolver().getQPath(jcrPath);
}
- /**
- * @inheritDoc
- */
+ @Override
public Path getPath(String identifier) throws MalformedPathException {
try {
int pos = identifier.indexOf('/');
@@ -3418,9 +3286,7 @@ public class RepositoryServiceImpl imple
}
}
- /**
- * @inheritDoc
- */
+ @Override
public void checkFormat(String identifier) throws MalformedPathException {
// cannot be determined. assume ok.
}
@@ -3446,37 +3312,27 @@ public class RepositoryServiceImpl imple
pResolver = new ParsingPathResolver(getPathFactory(), nResolver);
}
- /**
- * @inheritDoc
- */
+ @Override
public Name getQName(String jcrName) throws IllegalNameException, NamespaceException {
return nResolver.getQName(jcrName);
}
- /**
- * @inheritDoc
- */
+ @Override
public String getJCRName(Name qName) throws NamespaceException {
return nResolver.getJCRName(qName);
}
- /**
- * @inheritDoc
- */
+ @Override
public Path getQPath(String path) throws MalformedPathException, IllegalNameException, NamespaceException {
return pResolver.getQPath(path);
}
- /**
- * @inheritDoc
- */
+ @Override
public Path getQPath(String path, boolean normalizeIdentifier) throws MalformedPathException, IllegalNameException, NamespaceException {
return pResolver.getQPath(path, normalizeIdentifier);
}
- /**
- * @inheritDoc
- */
+ @Override
public String getJCRPath(Path path) throws NamespaceException {
return pResolver.getJCRPath(path);
}
@@ -3506,6 +3362,7 @@ public class RepositoryServiceImpl imple
//----------------------------------------------< NamespaceResolver >---
+ @Override
public String getURI(String prefix) throws NamespaceException {
String uri = prefixToURI.get(prefix);
if (uri != null) {
@@ -3515,6 +3372,7 @@ public class RepositoryServiceImpl imple
}
}
+ @Override
public String getPrefix(String uri) throws NamespaceException {
String prefix = uriToPrefix.get(uri);
if (prefix != null) {
Modified: jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java Mon Dec 12 12:03:43 2016
@@ -276,7 +276,7 @@ public class RepositoryServiceImpl exten
/**
* @see RepositoryService#getQValueFactory()
*/
- public QValueFactoryImpl getQValueFactory(SessionInfo sessionInfo) throws RepositoryException {
+ private QValueFactoryImpl getQValueFactory(SessionInfo sessionInfo) throws RepositoryException {
QValueFactoryImpl qv;
if (qvFactories.containsKey(sessionInfo)) {
qv = qvFactories.get(sessionInfo);
@@ -336,7 +336,7 @@ public class RepositoryServiceImpl exten
* @see RepositoryService#getItemInfos(SessionInfo, ItemId)
*/
@Override
- public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws ItemNotFoundException, RepositoryException {
+ public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException {
if (!itemId.denotesNode()) {
PropertyInfo propertyInfo = getPropertyInfo(sessionInfo, (PropertyId) itemId);
return Iterators.singleton(propertyInfo);
@@ -896,14 +896,14 @@ public class RepositoryServiceImpl exten
return removedNodePath;
}
}
-
+
//--------------------------------------------------------------------------
class JsonTree extends AbstractTree {
private final StringBuilder properties = new StringBuilder();
private final List<Part> parts = new ArrayList<Part>();
private final SessionInfo sessionInfo;
-
+
JsonTree(SessionInfo sessionInfo, Name nodeName, Name ntName, String uniqueId, NamePathResolver resolver) {
super(nodeName, ntName, uniqueId, resolver);
this.sessionInfo = sessionInfo;
@@ -920,15 +920,14 @@ public class RepositoryServiceImpl exten
public void addProperty(NodeId parentId, Name propertyName, int propertyType, QValue value) throws RepositoryException {
properties.append(',');
properties.append(Utils.getJsonKey(getResolver().getJCRName(propertyName)));
-
+
String valueStr = Utils.getJsonString(value);
- if (valueStr == null) {
- String jcrPropPath = createPath(parentId, propertyName);
- Utils.addPart(jcrPropPath, value, getResolver(), parts);
+ if (valueStr == null) {
+ String jcrPropPath = createPath(parentId, propertyName);
+ Utils.addPart(jcrPropPath, value, getResolver(), parts);
} else {
- properties.append(valueStr);
+ properties.append(valueStr);
}
-
}
@Override
@@ -940,8 +939,8 @@ public class RepositoryServiceImpl exten
properties.append('[');
for (QValue value : values) {
String valueStr = Utils.getJsonString(value);
- if (valueStr == null) {
- String jcrPropPath = createPath(parentId, propertyName);
+ if (valueStr == null) {
+ String jcrPropPath = createPath(parentId, propertyName);
Utils.addPart(jcrPropPath, value, getResolver(), parts);
} else {
String delim = (index++ == 0) ? "" : ",";
@@ -950,24 +949,24 @@ public class RepositoryServiceImpl exten
}
properties.append(']');
}
-
+
private String createPath(NodeId parentId, Name propertyName) throws RepositoryException {
- Path propPath = getPathFactory().create(getPath(parentId, sessionInfo), propertyName, true);
- return getResolver().getJCRPath(propPath);
+ Path propPath = getPathFactory().create(getPath(parentId, sessionInfo), propertyName, true);
+ return getResolver().getJCRPath(propPath);
}
-
+
//--------------------------------------------------------------------------
String toJsonString(List<Part> batchParts) throws RepositoryException {
- batchParts.addAll(this.parts);
- for (Tree child : this.getChildren()) {
- batchParts.addAll(((JsonTree) child).getParts());
- }
+ batchParts.addAll(this.parts);
+ for (Tree child : this.getChildren()) {
+ batchParts.addAll(((JsonTree) child).getParts());
+ }
StringBuilder json = new StringBuilder();
createJsonNodeFragment(json, this, true);
return json.toString();
- }
-
+ }
+
//--------------------------------------------------------------------------
private String createJsonNodeFragment(StringBuilder json, JsonTree tree, boolean start) throws RepositoryException {
if (!start) {
@@ -991,13 +990,13 @@ public class RepositoryServiceImpl exten
json.append('}');
return json.toString();
}
-
+
private StringBuilder getProperties() {
- return properties;
+ return properties;
}
-
+
private List<Part> getParts() {
- return parts;
+ return parts;
}
}
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/AclMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/AclMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/AclMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/AclMethod.java Mon Dec 12 12:03:43 2016
@@ -16,21 +16,17 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
-import org.apache.jackrabbit.webdav.DavServletResponse;
+import java.io.IOException;
+
import org.apache.jackrabbit.webdav.DavMethods;
+import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.security.AclProperty;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
/**
* <code>AclMethod</code>...
*/
public class AclMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(AclMethod.class);
-
public AclMethod(String uri, AclProperty aclProperty) throws IOException {
super(uri);
setRequestBody(aclProperty);
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/BaselineControlMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/BaselineControlMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/BaselineControlMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/BaselineControlMethod.java Mon Dec 12 12:03:43 2016
@@ -16,8 +16,10 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.version.DeltaVConstants;
@@ -25,16 +27,11 @@ import org.apache.jackrabbit.webdav.xml.
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-
/**
* <code>BaselineControlMethod</code>...
*/
public class BaselineControlMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(BaselineControlMethod.class);
-
public BaselineControlMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckinMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckinMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckinMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckinMethod.java Mon Dec 12 12:03:43 2016
@@ -19,16 +19,12 @@ package org.apache.jackrabbit.webdav.cli
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.version.DeltaVConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* <code>CheckinMethod</code>...
*/
public class CheckinMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(CheckinMethod.class);
-
public CheckinMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckoutMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckoutMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckoutMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CheckoutMethod.java Mon Dec 12 12:03:43 2016
@@ -18,17 +18,12 @@ package org.apache.jackrabbit.webdav.cli
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* <code>CheckoutMethod</code>...
*/
public class CheckoutMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(CheckoutMethod.class);
-
-
public CheckoutMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CopyMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CopyMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CopyMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/CopyMethod.java Mon Dec 12 12:03:43 2016
@@ -21,16 +21,12 @@ import org.apache.jackrabbit.webdav.DavM
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.header.DepthHeader;
import org.apache.jackrabbit.webdav.header.OverwriteHeader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* <code>CopyMethod</code>...
*/
public class CopyMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(CopyMethod.class);
-
/**
* Create a new <code>CopyMethod</code>
*
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DeleteMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DeleteMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DeleteMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DeleteMethod.java Mon Dec 12 12:03:43 2016
@@ -16,8 +16,6 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
@@ -26,8 +24,6 @@ import org.apache.jackrabbit.webdav.DavS
*/
public class DeleteMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(DeleteMethod.class);
-
public DeleteMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/LabelMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/LabelMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/LabelMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/LabelMethod.java Mon Dec 12 12:03:43 2016
@@ -16,22 +16,18 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
+import java.io.IOException;
+
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.header.DepthHeader;
import org.apache.jackrabbit.webdav.version.LabelInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
/**
* <code>LabelMethod</code>...
*/
public class LabelMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(LabelMethod.class);
-
/**
* Create a new <code>LabelMethod</code> with the default depth.
*
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MergeMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MergeMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MergeMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MergeMethod.java Mon Dec 12 12:03:43 2016
@@ -16,21 +16,17 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
+import java.io.IOException;
+
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.version.MergeInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
/**
* <code>MergeMethod</code>...
*/
public class MergeMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(MergeMethod.class);
-
public MergeMethod(String uri, MergeInfo mergeInfo) throws IOException {
super(uri);
setRequestBody(mergeInfo);
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkActivityMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkActivityMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkActivityMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkActivityMethod.java Mon Dec 12 12:03:43 2016
@@ -16,8 +16,6 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
@@ -26,8 +24,6 @@ import org.apache.jackrabbit.webdav.DavS
*/
public class MkActivityMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(MkActivityMethod.class);
-
public MkActivityMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkColMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkColMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkColMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkColMethod.java Mon Dec 12 12:03:43 2016
@@ -18,16 +18,12 @@ package org.apache.jackrabbit.webdav.cli
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* <code>MkColMethod</code>...
*/
public class MkColMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(MkColMethod.class);
-
public MkColMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkWorkspaceMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkWorkspaceMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkWorkspaceMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MkWorkspaceMethod.java Mon Dec 12 12:03:43 2016
@@ -18,16 +18,12 @@ package org.apache.jackrabbit.webdav.cli
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* <code>MkWorkspaceMethod</code>...
*/
public class MkWorkspaceMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(MkWorkspaceMethod.class);
-
public MkWorkspaceMethod(String uri) {
super(uri);
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MoveMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MoveMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MoveMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/MoveMethod.java Mon Dec 12 12:03:43 2016
@@ -20,16 +20,12 @@ import org.apache.jackrabbit.webdav.DavC
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.header.OverwriteHeader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* <code>MoveMethod</code>...
*/
public class MoveMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(MoveMethod.class);
-
public MoveMethod(String uri, String destinationUri, boolean overwrite) {
super(uri);
setRequestHeader(DavConstants.HEADER_DESTINATION, destinationUri);
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OptionsMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OptionsMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OptionsMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OptionsMethod.java Mon Dec 12 12:03:43 2016
@@ -16,29 +16,25 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpConnection;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.HttpState;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.version.OptionsInfo;
import org.apache.jackrabbit.webdav.version.OptionsResponse;
-import org.apache.commons.httpclient.HttpConnection;
-import org.apache.commons.httpclient.HttpState;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
/**
* <code>OptionsMethod</code>...
*/
public class OptionsMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(OptionsMethod.class);
-
private final Set<String> allowedMethods = new HashSet<String>();
private final Set<String> complianceClasses = new HashSet<String>();
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OrderPatchMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OrderPatchMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OrderPatchMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/OrderPatchMethod.java Mon Dec 12 12:03:43 2016
@@ -16,23 +16,19 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
+import java.io.IOException;
+
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.ordering.OrderPatch;
import org.apache.jackrabbit.webdav.ordering.OrderingConstants;
import org.apache.jackrabbit.webdav.ordering.Position;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
/**
* <code>OrderPatchMethod</code>...
*/
public class OrderPatchMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(OrderPatchMethod.class);
-
/**
* Create a new <code>OrderPatchMethod</code> with the given order patch
* object.
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java Mon Dec 12 12:03:43 2016
@@ -15,24 +15,20 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.io.IOException;
+
+import org.apache.commons.httpclient.HttpConnection;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
-import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.header.PollTimeoutHeader;
-import org.apache.jackrabbit.webdav.xml.DomUtil;
-import org.apache.jackrabbit.webdav.xml.ElementIterator;
-import org.apache.jackrabbit.webdav.observation.ObservationConstants;
import org.apache.jackrabbit.webdav.observation.EventDiscovery;
-import org.apache.jackrabbit.webdav.observation.EventBundle;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.HttpState;
-import org.apache.commons.httpclient.HttpConnection;
+import org.apache.jackrabbit.webdav.observation.ObservationConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-
-import java.io.IOException;
/**
* <code>PollMethod</code> implementation.
@@ -112,23 +108,13 @@ public class PollMethod extends DavMetho
* @param root
* @return
*/
- private boolean buildDiscoveryFromRoot(Element root) {
- if (DomUtil.matches(root, XML_EVENTDISCOVERY, ObservationConstants.NAMESPACE)) {
- eventDiscovery = new EventDiscovery();
- ElementIterator it = DomUtil.getChildren(root, XML_EVENTBUNDLE, ObservationConstants.NAMESPACE);
- while (it.hasNext()) {
- final Element ebElement = it.nextElement();
- EventBundle eb = new EventBundle() {
- public Element toXml(Document document) {
- return (Element) document.importNode(ebElement, true);
- }
- };
- eventDiscovery.addEventBundle(eb);
- }
- return true;
- } else {
- log.debug("Missing 'eventdiscovery' response body in POLL method.");
- }
- return false;
- }
+ private boolean buildDiscoveryFromRoot(Element root) {
+ try {
+ eventDiscovery = EventDiscovery.createFromXml(root);
+ return true;
+ } catch (IllegalArgumentException ex) {
+ log.debug("Missing 'eventdiscovery' response body in POLL method.", ex);
+ return false;
+ }
+ }
}
Modified: jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PropFindMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PropFindMethod.java?rev=1773777&r1=1773776&r2=1773777&view=diff
==============================================================================
--- jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PropFindMethod.java (original)
+++ jackrabbit/branches/2.12/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PropFindMethod.java Mon Dec 12 12:03:43 2016
@@ -16,20 +16,14 @@
*/
package org.apache.jackrabbit.webdav.client.methods;
+import java.io.IOException;
+
import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.header.DepthHeader;
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
-import org.apache.jackrabbit.webdav.xml.DomUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
+import org.apache.jackrabbit.webdav.property.PropfindInfo;
/**
* <code>PropFindMethod</code>, as specified in
@@ -53,8 +47,6 @@ import java.io.IOException;
*/
public class PropFindMethod extends DavMethodBase {
- private static Logger log = LoggerFactory.getLogger(PropFindMethod.class);
-
public PropFindMethod(String uri) throws IOException {
this(uri, PROPFIND_ALL_PROP, new DavPropertyNameSet(), DEPTH_INFINITY);
}
@@ -76,57 +68,8 @@ public class PropFindMethod extends DavM
DepthHeader dh = new DepthHeader(depth);
setRequestHeader(dh.getHeaderName(), dh.getHeaderValue());
- // build the request body
- try {
- // create the document and attach the root element
- Document document = DomUtil.createDocument();
- Element propfind = DomUtil.createElement(document, XML_PROPFIND, NAMESPACE);
- document.appendChild(propfind);
-
- // fill the propfind element
- switch (propfindType) {
- case PROPFIND_ALL_PROP:
- propfind.appendChild(DomUtil.createElement(document, XML_ALLPROP, NAMESPACE));
- break;
-
- case PROPFIND_PROPERTY_NAMES:
- propfind.appendChild(DomUtil.createElement(document, XML_PROPNAME, NAMESPACE));
- break;
-
- case PROPFIND_BY_PROPERTY:
- if (propNameSet == null) {
- // name set missing, ask for a property that is known to exist
- Element prop = DomUtil.createElement(document, XML_PROP, NAMESPACE);
- Element resourcetype = DomUtil.createElement(document, PROPERTY_RESOURCETYPE, NAMESPACE);
- prop.appendChild(resourcetype);
- propfind.appendChild(prop);
- } else {
- propfind.appendChild(propNameSet.toXml(document));
- }
- break;
-
- case PROPFIND_ALL_PROP_INCLUDE:
- propfind.appendChild(DomUtil.createElement(document, XML_ALLPROP, NAMESPACE));
- if (propNameSet != null && ! propNameSet.isEmpty()) {
- Element include = DomUtil.createElement(document, XML_INCLUDE, NAMESPACE);
- Element prop = propNameSet.toXml(document);
- for (Node c = prop.getFirstChild(); c != null; c = c.getNextSibling()) {
- // copy over the children of <prop> to <include> element
- include.appendChild(c.cloneNode(true));
- }
- propfind.appendChild(include);
- }
- break;
-
- default:
- throw new IllegalArgumentException("unknown propfind type");
- }
-
- // set the request body
- setRequestBody(document);
- } catch (ParserConfigurationException e) {
- throw new IOException(e.getMessage());
- }
+ PropfindInfo info = new PropfindInfo(propfindType, propNameSet);
+ setRequestBody(info);
}
//---------------------------------------------------------< HttpMethod >---