jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1772457 - in /jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit: spi2dav/RepositoryServiceImpl.java spi2davex/RepositoryServiceImpl.java
Date Sat, 03 Dec 2016 11:12:32 GMT
Author: reschke
Date: Sat Dec  3 11:12:32 2016
New Revision: 1772457

URL: http://svn.apache.org/viewvc?rev=1772457&view=rev
Log:
JCR-4064: Refactor WebDAV related code out of HttpClient3-specific classes for better future
re-use

Tabs and whitespace

Modified:
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=1772457&r1=1772456&r2=1772457&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Sat Dec  3 11:12:32 2016
@@ -281,7 +281,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 +405,7 @@ public class RepositoryServiceImpl imple
                 method.setRequestHeader(ifH.getHeaderName(), ifH.getHeaderValue());
             }
         }
-        
+
         initMethod(method, sessionInfo);
     }
 
@@ -954,7 +954,7 @@ public class RepositoryServiceImpl imple
             }
         }
     }
-    
+
     private PrivilegeDefinition[] internalGetPrivilegeDefinitions(SessionInfo sessionInfo,
String uri) throws RepositoryException {
         DavPropertyNameSet nameSet = new DavPropertyNameSet();
         nameSet.add(SecurityConstants.SUPPORTED_PRIVILEGE_SET);
@@ -985,7 +985,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);
                         }
@@ -1306,7 +1306,7 @@ public class RepositoryServiceImpl imple
         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);
@@ -1377,7 +1377,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());
@@ -1407,7 +1407,6 @@ public class RepositoryServiceImpl imple
             }
 
             return new PropertyInfoImpl(propertyId, path, type, isMultiValued, values);
-            
         } catch (IOException e) {
             throw new RepositoryException(e);
         } catch (DavException e) {
@@ -2398,7 +2397,6 @@ public class RepositoryServiceImpl imple
                 } catch (RepositoryException e) {
                     log.warn("Unable to build event parentId: {}", e.getMessage());
                 }
-                
             }
 
             if (userId == null) {
@@ -2545,7 +2543,7 @@ public class RepositoryServiceImpl imple
     }
 
     @Override
-    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo)
throws RepositoryException {       
+    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo)
throws RepositoryException {
         ReportMethod method = null;
         try {
             ReportInfo info = new ReportInfo(JcrRemotingConstants.REPORT_NODETYPES, ItemResourceConstants.NAMESPACE);
@@ -2581,7 +2579,7 @@ public class RepositoryServiceImpl imple
     @Override
     public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions,
boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException,
RepositoryException {
         PropPatchMethod method = null;
-     	try {
+        try {
              DavPropertySet setProperties = new DavPropertySet();
              setProperties.add(createRegisterNodeTypesProperty(sessionInfo, nodeTypeDefinitions,
allowUpdate));
              String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
@@ -2603,7 +2601,7 @@ public class RepositoryServiceImpl imple
     @Override
     public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws
UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException {
         PropPatchMethod method = null;
-     	try {
+        try {
              DavPropertySet setProperties = new DavPropertySet();
              setProperties.add(createUnRegisterNodeTypesProperty(sessionInfo, nodeTypeNames));
              String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
@@ -2629,7 +2627,7 @@ public class RepositoryServiceImpl imple
         }
 
         MkWorkspaceMethod method = null;
-     	try {
+        try {
              method = new MkWorkspaceMethod(uriResolver.getWorkspaceUri(name));
              initMethod(method, sessionInfo, true);
              getClient(sessionInfo).executeMethod(method);
@@ -2648,7 +2646,7 @@ public class RepositoryServiceImpl imple
     @Override
     public void deleteWorkspace(SessionInfo sessionInfo, String name) throws AccessDeniedException,
UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException {
         DeleteMethod method = null;
-     	try {
+        try {
              method = new DeleteMethod(uriResolver.getWorkspaceUri(name));
              initMethod(method, sessionInfo, true);
              getClient(sessionInfo).executeMethod(method);

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=1772457&r1=1772456&r2=1772457&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
Sat Dec  3 11:12:32 2016
@@ -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;
         }
     }
 }



Mime
View raw message