jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1640344 - /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/
Date Tue, 18 Nov 2014 13:51:00 GMT
Author: angela
Date: Tue Nov 18 13:50:59 2014
New Revision: 1640344

URL: http://svn.apache.org/r1640344
Log:
minor improvement: adding @Override annotations, removing unused imports, replacing Session#checkPermission
by #hasPermission

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/EventJournalResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavSession.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/RootCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
Tue Nov 18 13:50:59 2014
@@ -51,7 +51,6 @@ import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
 import javax.jcr.RepositoryException;
 import javax.jcr.Workspace;
-import java.security.AccessControlException;
 import java.util.ArrayList;
 import java.util.List;
 import java.io.IOException;
@@ -144,11 +143,8 @@ abstract class AbstractItemResource exte
                 for (Privilege priv : allPrivs) {
                     try {
                         String path = getLocator().getRepositoryPath();
-                        getRepositorySession().checkPermission(path, priv.getName());
+                        getRepositorySession().hasPermission(path, priv.getName());
                         currentPrivs.add(priv);
-                    } catch (AccessControlException e) {
-                        // ignore
-                        log.debug(e.toString());
                     } catch (RepositoryException e) {
                         // ignore
                         log.debug(e.toString());
@@ -164,6 +160,7 @@ abstract class AbstractItemResource exte
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getSupportedMethods()
      */
+    @Override
     public String getSupportedMethods() {
         return ItemResourceConstants.METHODS;
     }
@@ -174,6 +171,7 @@ abstract class AbstractItemResource exte
      *
      * @see org.apache.jackrabbit.webdav.DavResource#exists()
      */
+    @Override
     public boolean exists() {
         return item != null;
     }
@@ -188,6 +186,7 @@ abstract class AbstractItemResource exte
      *
      * @see org.apache.jackrabbit.webdav.DavResource#getDisplayName()
      */
+    @Override
     public String getDisplayName() {
         String resPath = getResourcePath();
         return (resPath != null) ? Text.getName(resPath) : resPath;
@@ -200,6 +199,7 @@ abstract class AbstractItemResource exte
      *
      * @see DavResource#spool(OutputContext)
      */
+    @Override
     public void spool(OutputContext outputContext) throws IOException {
         if (!initedProps) {
             initProperties();
@@ -241,6 +241,7 @@ abstract class AbstractItemResource exte
      * repository node.
      * @see org.apache.jackrabbit.webdav.DavResource#getCollection()
      */
+    @Override
     public DavResource getCollection() {
         DavResource collection = null;
 
@@ -339,6 +340,7 @@ abstract class AbstractItemResource exte
     /**
      * @see ObservationResource#init(SubscriptionManager)
      */
+    @Override
     public void init(SubscriptionManager subsMgr) {
         this.subsMgr = subsMgr;
     }
@@ -347,6 +349,7 @@ abstract class AbstractItemResource exte
      * @see ObservationResource#subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo,
String)
      * @see SubscriptionManager#subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo,
String, org.apache.jackrabbit.webdav.observation.ObservationResource)
      */
+    @Override
     public Subscription subscribe(SubscriptionInfo info, String subscriptionId)
             throws DavException {
         return subsMgr.subscribe(info, subscriptionId, this);
@@ -356,6 +359,7 @@ abstract class AbstractItemResource exte
      * @see ObservationResource#unsubscribe(String)
      * @see SubscriptionManager#unsubscribe(String, org.apache.jackrabbit.webdav.observation.ObservationResource)
      */
+    @Override
     public void unsubscribe(String subscriptionId) throws DavException {
         subsMgr.unsubscribe(subscriptionId, this);
     }
@@ -364,6 +368,7 @@ abstract class AbstractItemResource exte
      * @see ObservationResource#poll(String, long)
      * @see SubscriptionManager#poll(String, long, org.apache.jackrabbit.webdav.observation.ObservationResource)
      */
+    @Override
     public EventDiscovery poll(String subscriptionId, long timeout) throws DavException {
         return subsMgr.poll(subscriptionId, timeout, this);
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
Tue Nov 18 13:50:59 2014
@@ -77,7 +77,6 @@ import javax.jcr.Session;
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.Event;
 import javax.jcr.observation.EventIterator;
-import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.ParserConfigurationException;
 
 import java.util.ArrayList;
@@ -151,6 +150,7 @@ abstract class AbstractResource implemen
      * @return string listing the compliance classes.
      * @see org.apache.jackrabbit.webdav.DavResource#getComplianceClass()
      */
+    @Override
     public String getComplianceClass() {
         return COMPLIANCE_CLASSES;
     }
@@ -158,6 +158,7 @@ abstract class AbstractResource implemen
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getLocator()
      */
+    @Override
     public DavResourceLocator getLocator() {
         return locator;
     }
@@ -171,6 +172,7 @@ abstract class AbstractResource implemen
      * @see DavResource#getResourcePath()
      * @see org.apache.jackrabbit.webdav.DavResourceLocator#getResourcePath()
      */
+    @Override
     public String getResourcePath() {
         return locator.getResourcePath();
     }
@@ -179,6 +181,7 @@ abstract class AbstractResource implemen
      * @see DavResource#getHref()
      * @see DavResourceLocator#getHref(boolean)
      */
+    @Override
     public String getHref() {
         return locator.getHref(isCollection());
     }
@@ -186,6 +189,7 @@ abstract class AbstractResource implemen
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getPropertyNames()
      */
+    @Override
     public DavPropertyName[] getPropertyNames() {
         initPropertyNames();
         return names.getContent().toArray(new DavPropertyName[names.getContentSize()]);
@@ -194,6 +198,7 @@ abstract class AbstractResource implemen
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
      */
+    @Override
     public DavProperty<?> getProperty(DavPropertyName name) {
         DavProperty prop = getProperties().get(name);
         if (prop == null) {
@@ -223,6 +228,7 @@ abstract class AbstractResource implemen
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getProperties()
      */
+    @Override
     public DavPropertySet getProperties() {
         if (!initedProps) {
             initProperties();
@@ -237,6 +243,7 @@ abstract class AbstractResource implemen
      * @throws DavException Always throws {@link DavServletResponse#SC_METHOD_NOT_ALLOWED}
      * @see org.apache.jackrabbit.webdav.DavResource#setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
      */
+    @Override
     public void setProperty(DavProperty<?> property) throws DavException {
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
     }
@@ -248,6 +255,7 @@ abstract class AbstractResource implemen
      * @throws DavException Always throws {@link DavServletResponse#SC_METHOD_NOT_ALLOWED}
      * @see org.apache.jackrabbit.webdav.DavResource#removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
      */
+    @Override
     public void removeProperty(DavPropertyName propertyName) throws DavException {
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
     }
@@ -257,6 +265,7 @@ abstract class AbstractResource implemen
      *
      * @see DavResource#alterProperties(List)
      */
+    @Override
     public MultiStatusResponse alterProperties(List<? extends PropEntry> changeList)
throws DavException {
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
     }
@@ -268,6 +277,7 @@ abstract class AbstractResource implemen
      * @throws DavException Always throws {@link DavServletResponse#SC_METHOD_NOT_ALLOWED}
      * @see DavResource#move(org.apache.jackrabbit.webdav.DavResource)
      */
+    @Override
     public void move(DavResource destination) throws DavException {
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
     }
@@ -280,6 +290,7 @@ abstract class AbstractResource implemen
      * @throws DavException Always throws {@link DavServletResponse#SC_METHOD_NOT_ALLOWED}
      * @see DavResource#copy(org.apache.jackrabbit.webdav.DavResource, boolean)
      */
+    @Override
     public void copy(DavResource destination, boolean shallow) throws DavException {
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
     }
@@ -295,6 +306,7 @@ abstract class AbstractResource implemen
      * @return true if this resource may be locked by the given type and scope.
      * @see DavResource#isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
      */
+    @Override
     public boolean isLockable(Type type, Scope scope) {
         return supportedLock.isSupportedLock(type, scope);
     }
@@ -307,6 +319,7 @@ abstract class AbstractResource implemen
      * @return true if this resource has a lock applied with the given type and scope.
      * @see DavResource#hasLock(Type, Scope)
      */
+    @Override
     public boolean hasLock(Type type, Scope scope) {
         return getLock(type, scope) != null;
     }
@@ -314,6 +327,7 @@ abstract class AbstractResource implemen
     /**
      * @see DavResource#getLock(Type, Scope)
      */
+    @Override
     public ActiveLock getLock(Type type, Scope scope) {
         ActiveLock lock = null;
         if (TransactionConstants.TRANSACTION.equals(type)) {
@@ -326,6 +340,7 @@ abstract class AbstractResource implemen
      * @see DavResource#getLocks()
      * todo improve....
      */
+    @Override
     public ActiveLock[] getLocks() {
         List<ActiveLock> locks = new ArrayList<ActiveLock>();
         // tx locks
@@ -353,6 +368,7 @@ abstract class AbstractResource implemen
     /**
      * @see DavResource#lock(org.apache.jackrabbit.webdav.lock.LockInfo)
      */
+    @Override
     public ActiveLock lock(LockInfo reqLockInfo) throws DavException {
         if (isLockable(reqLockInfo.getType(), reqLockInfo.getScope())) {
             return txMgr.createLock(reqLockInfo, this);
@@ -369,6 +385,7 @@ abstract class AbstractResource implemen
      * @throws DavException
      * @see DavResource#refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String)
      */
+    @Override
     public ActiveLock refreshLock(LockInfo info, String lockToken) throws DavException {
         return txMgr.refreshLock(info, lockToken, this);
     }
@@ -381,6 +398,7 @@ abstract class AbstractResource implemen
      * @param lockToken
      * @throws DavException Always throws {@link DavServletResponse#SC_METHOD_NOT_ALLOWED}
      */
+    @Override
     public void unlock(String lockToken) throws DavException {
         throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED);
     }
@@ -388,6 +406,7 @@ abstract class AbstractResource implemen
     /**
      * @see DavResource#addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)
      */
+    @Override
     public void addLockManager(LockManager lockMgr) {
         if (lockMgr instanceof TxLockManagerImpl) {
             txMgr = (TxLockManagerImpl) lockMgr;
@@ -397,6 +416,7 @@ abstract class AbstractResource implemen
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getFactory()
      */
+    @Override
     public DavResourceFactory getFactory() {
         return factory;
     }
@@ -406,6 +426,7 @@ abstract class AbstractResource implemen
      * @see org.apache.jackrabbit.webdav.transaction.TransactionResource#getSession()
      * @see org.apache.jackrabbit.webdav.observation.ObservationResource#getSession()
      */
+    @Override
     public DavSession getSession() {
         return session;
     }
@@ -414,6 +435,7 @@ abstract class AbstractResource implemen
     /**
      * @see TransactionResource#init(TxLockManager, String)
      */
+    @Override
     public void init(TxLockManager txMgr, String transactionId) {
         this.txMgr = (TxLockManagerImpl) txMgr;
         this.transactionId = transactionId;
@@ -422,6 +444,7 @@ abstract class AbstractResource implemen
     /**
      * @see TransactionResource#unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)
      */
+    @Override
     public void unlock(String lockToken, TransactionInfo tInfo) throws DavException {
         txMgr.releaseLock(tInfo, lockToken, this);
     }
@@ -429,6 +452,7 @@ abstract class AbstractResource implemen
     /**
      * @see TransactionResource#getTransactionId()
      */
+    @Override
     public String getTransactionId() {
         return transactionId;
     }
@@ -439,6 +463,7 @@ abstract class AbstractResource implemen
      * @return object to be used in the OPTIONS response body or <code>null</code>
      * @see DeltaVResource#getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo)
      */
+    @Override
     public OptionsResponse getOptionResponse(OptionsInfo optionsInfo) {
         OptionsResponse oR = null;
         if (optionsInfo != null) {
@@ -465,6 +490,7 @@ abstract class AbstractResource implemen
      * @throws DavException
      * @see DeltaVResource#getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo)
      */
+    @Override
     public Report getReport(ReportInfo reportInfo) throws DavException {
         if (reportInfo == null) {
             throw new DavException(DavServletResponse.SC_BAD_REQUEST, "A REPORT request must
provide a valid XML request body.");
@@ -495,6 +521,7 @@ abstract class AbstractResource implemen
      * @throws DavException Always throws.
      * @see DeltaVResource#addWorkspace(org.apache.jackrabbit.webdav.DavResource)
      */
+    @Override
     public void addWorkspace(DavResource workspace) throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -508,6 +535,7 @@ abstract class AbstractResource implemen
      * @throws DavException
      * @see DeltaVResource#getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)
      */
+    @Override
     public DavResource[] getReferenceResources(DavPropertyName hrefPropertyName) throws DavException
{
         DavProperty<?> prop = getProperty(hrefPropertyName);
         if (prop == null || !(prop instanceof HrefProperty)) {
@@ -557,6 +585,7 @@ abstract class AbstractResource implemen
      * @return
      * @see org.apache.jackrabbit.webdav.search.SearchResource#getQueryGrammerSet()
      */
+    @Override
     public QueryGrammerSet getQueryGrammerSet() {
         return new SearchResourceImpl(getLocator(), session).getQueryGrammerSet();
     }
@@ -567,6 +596,7 @@ abstract class AbstractResource implemen
      * @throws DavException
      * @see SearchResource#search(org.apache.jackrabbit.webdav.search.SearchInfo)
      */
+    @Override
     public MultiStatus search(SearchInfo sInfo) throws DavException {
         return new SearchResourceImpl(getLocator(), session).search(sInfo);
     }
@@ -779,6 +809,7 @@ abstract class AbstractResource implemen
         /**
          * @see EventListener#onEvent(javax.jcr.observation.EventIterator)
          */
+        @Override
         public void onEvent(EventIterator events) {
             while (events.hasNext()) {
                 try {

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
Tue Nov 18 13:50:59 2014
@@ -54,7 +54,6 @@ import org.apache.jackrabbit.server.io.I
 import org.apache.jackrabbit.util.Text;
 import org.apache.jackrabbit.webdav.DavCompliance;
 import org.apache.jackrabbit.webdav.DavException;
-import org.apache.jackrabbit.webdav.DavLocatorFactory;
 import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavResourceFactory;
 import org.apache.jackrabbit.webdav.DavResourceIterator;
@@ -137,6 +136,7 @@ public class DefaultItemCollection exten
         }
     }
 
+    @Override
     public long getModificationTime() {
         // retrieve mod-time from jcr:lastmodified property if existing
         if (exists()) {
@@ -173,6 +173,7 @@ public class DefaultItemCollection exten
      * @return true
      * @see org.apache.jackrabbit.webdav.DavResource#isCollection()
      */
+    @Override
     public boolean isCollection() {
         return true;
     }
@@ -417,6 +418,7 @@ public class DefaultItemCollection exten
      * @see Node#addNode(String)
      * @see Node#setProperty(String, java.io.InputStream)
      */
+    @Override
     public void addMember(DavResource resource, InputContext inputContext)
             throws DavException {
 
@@ -525,6 +527,7 @@ public class DefaultItemCollection exten
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getMembers()
      */
+    @Override
     public DavResourceIterator getMembers() {
         ArrayList<DavResource> memberList = new ArrayList<DavResource>();
         if (exists()) {
@@ -564,6 +567,7 @@ public class DefaultItemCollection exten
      * @see DavResource#removeMember(DavResource)
      * @see javax.jcr.Item#remove()
      */
+    @Override
     public void removeMember(DavResource member) throws DavException {
         Session session = getRepositorySession();
         try {
@@ -794,6 +798,7 @@ public class DefaultItemCollection exten
      * @see org.apache.jackrabbit.webdav.ordering.OrderingResource#isOrderable()
      * @see javax.jcr.nodetype.NodeType#hasOrderableChildNodes()
      */
+    @Override
     public boolean isOrderable() {
         boolean orderable = false;
         if (exists()) {
@@ -815,6 +820,7 @@ public class DefaultItemCollection exten
      * @see org.apache.jackrabbit.webdav.ordering.OrderingResource#orderMembers(org.apache.jackrabbit.webdav.ordering.OrderPatch)
      * @see Node#orderBefore(String, String)
      */
+    @Override
     public void orderMembers(OrderPatch orderPatch) throws DavException {
         if (!isOrderable()) {
             throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemResource.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemResource.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemResource.java
Tue Nov 18 13:50:59 2014
@@ -95,6 +95,7 @@ public class DefaultItemResource extends
      * @return false
      * @see DavResource#isCollection()
      */
+    @Override
     public boolean isCollection() {
         return false;
     }
@@ -105,6 +106,7 @@ public class DefaultItemResource extends
      * @return
      * @see DavResource#getModificationTime()
      */
+    @Override
     public long getModificationTime() {
         return new Date().getTime();
     }
@@ -302,6 +304,7 @@ public class DefaultItemResource extends
      *
      * @see org.apache.jackrabbit.webdav.DavResource#addMember(org.apache.jackrabbit.webdav.DavResource,
InputContext)
      */
+    @Override
     public void addMember(DavResource resource, InputContext inputContext) throws DavException
{
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED, "Cannot add members
to a non-collection resource");
     }
@@ -313,6 +316,7 @@ public class DefaultItemResource extends
      * @return an empty iterator
      * @see DavResource#getMembers()
      */
+    @Override
     public DavResourceIterator getMembers() {
         log.warn("A non-collection resource never has internal members.");
         List<DavResource> drl = Collections.emptyList();
@@ -324,6 +328,7 @@ public class DefaultItemResource extends
      *
      * @see DavResource#removeMember(DavResource)
      */
+    @Override
     public void removeMember(DavResource member) throws DavException {
         throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED, "Cannot remove members
from a non-collection resource");
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/EventJournalResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/EventJournalResourceImpl.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/EventJournalResourceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/EventJournalResourceImpl.java
Tue Nov 18 13:50:59 2014
@@ -99,10 +99,12 @@ public class EventJournalResourceImpl ex
         this.request = request;
     }
 
+    @Override
     public String getSupportedMethods() {
         return "GET, HEAD";
     }
 
+    @Override
     public boolean exists() {
         try {
             List<String> available = Arrays.asList(getRepositorySession().getWorkspace().getAccessibleWorkspaceNames());
@@ -113,14 +115,17 @@ public class EventJournalResourceImpl ex
         }
     }
 
+    @Override
     public boolean isCollection() {
         return false;
     }
 
+    @Override
     public String getDisplayName() {
         return "event journal for " + getLocator().getWorkspaceName();
     }
 
+    @Override
     public long getModificationTime() {
         return System.currentTimeMillis();
     }
@@ -152,6 +157,7 @@ public class EventJournalResourceImpl ex
 
     private static final Attributes NOATTRS = new AttributesImpl();
 
+    @Override
     public void spool(OutputContext outputContext) throws IOException {
 
         Calendar cal = Calendar.getInstance(Locale.ENGLISH);
@@ -412,18 +418,22 @@ public class EventJournalResourceImpl ex
         }
     }
 
+    @Override
     public DavResource getCollection() {
         return null;
     }
 
+    @Override
     public void addMember(DavResource resource, InputContext inputContext) throws DavException
{
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
 
+    @Override
     public DavResourceIterator getMembers() {
         return DavResourceIteratorImpl.EMPTY;
     }
 
+    @Override
     public void removeMember(DavResource member) throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavSession.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavSession.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavSession.java
Tue Nov 18 13:50:59 2014
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.webdav.jcr
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.DavSession;
-import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.jcr.lock.LockTokenMapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -98,6 +97,7 @@ public abstract class JcrDavSession impl
      * @param token
      * @see DavSession#addLockToken(String)
      */
+    @Override
     public void addLockToken(String token) {
         if (!LockTokenMapper.isForSessionScopedLock(token)) {
             try {
@@ -115,6 +115,7 @@ public abstract class JcrDavSession impl
      * @return
      * @see DavSession#getLockTokens()
      */
+    @Override
     public String[] getLockTokens() {
         return lockTokens.toArray(new String[lockTokens.size()]);
     }
@@ -124,6 +125,7 @@ public abstract class JcrDavSession impl
      * @param token
      * @see DavSession#removeLockToken(String)
      */
+    @Override
     public void removeLockToken(String token) {
         if (!LockTokenMapper.isForSessionScopedLock(token)) {
             try {

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/RootCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/RootCollection.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/RootCollection.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/RootCollection.java
Tue Nov 18 13:50:59 2014
@@ -76,6 +76,7 @@ public class RootCollection extends Abst
      * @return string listing the METHODS allowed
      * @see org.apache.jackrabbit.webdav.DavResource#getSupportedMethods()
      */
+    @Override
     public String getSupportedMethods() {
         StringBuilder sb = new StringBuilder(DavResource.METHODS);
         sb.append(", ");
@@ -91,6 +92,7 @@ public class RootCollection extends Abst
      * @return true
      * @see org.apache.jackrabbit.webdav.DavResource#exists()
      */
+    @Override
     public boolean exists() {
         return true;
     }
@@ -101,6 +103,7 @@ public class RootCollection extends Abst
      * @return true
      * @see org.apache.jackrabbit.webdav.DavResource#isCollection()
      */
+    @Override
     public boolean isCollection() {
         return true;
     }
@@ -111,6 +114,7 @@ public class RootCollection extends Abst
      * @return empty string
      * @see org.apache.jackrabbit.webdav.DavResource#getDisplayName()
      */
+    @Override
     public String getDisplayName() {
         return "";
     }
@@ -121,6 +125,7 @@ public class RootCollection extends Abst
      * @return
      * @see org.apache.jackrabbit.webdav.DavResource#getModificationTime()
      */
+    @Override
     public long getModificationTime() {
         return new Date().getTime();
     }
@@ -132,6 +137,7 @@ public class RootCollection extends Abst
      * @throws IOException
      * @see DavResource#spool(org.apache.jackrabbit.webdav.io.OutputContext)
      */
+    @Override
     public void spool(OutputContext outputContext) throws IOException {
         if (outputContext.hasStream()) {
             Session session = getRepositorySession();
@@ -180,6 +186,7 @@ public class RootCollection extends Abst
      * of any resource.
      * @see org.apache.jackrabbit.webdav.DavResource#getCollection()
      */
+    @Override
     public DavResource getCollection() {
         return null;
     }
@@ -188,6 +195,7 @@ public class RootCollection extends Abst
      * Throws exception: 403 Forbidden.
      * @see DavResource#addMember(DavResource, InputContext)
      */
+    @Override
     public void addMember(DavResource resource, InputContext inputContext) throws DavException
{
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -199,6 +207,7 @@ public class RootCollection extends Abst
      * @return members of this collection
      * @see org.apache.jackrabbit.webdav.DavResource#getMembers()
      */
+    @Override
     public DavResourceIterator getMembers() {
         List<DavResource> memberList = new ArrayList();
         try {
@@ -223,6 +232,7 @@ public class RootCollection extends Abst
      *
      * @see DavResource#removeMember(org.apache.jackrabbit.webdav.DavResource)
      */
+    @Override
     public void removeMember(DavResource member) throws DavException {
         Workspace wsp = getRepositorySession().getWorkspace();
         String name = Text.getName(member.getResourcePath());

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
Tue Nov 18 13:50:59 2014
@@ -281,6 +281,7 @@ public class VersionControlledItemCollec
      * exist yet or if an error occurs while making the underlying node versionable.
      * @see org.apache.jackrabbit.webdav.version.VersionableResource#addVersionControl()
      */
+    @Override
     public void addVersionControl() throws DavException {
         if (!exists()) {
             throw new DavException(DavServletResponse.SC_NOT_FOUND);
@@ -302,6 +303,7 @@ public class VersionControlledItemCollec
      * @throws org.apache.jackrabbit.webdav.DavException
      * @see org.apache.jackrabbit.webdav.version.VersionControlledResource#checkin()
      */
+    @Override
     public String checkin() throws DavException {
         if (!exists()) {
             throw new DavException(DavServletResponse.SC_NOT_FOUND);
@@ -325,6 +327,7 @@ public class VersionControlledItemCollec
      * @throws org.apache.jackrabbit.webdav.DavException
      * @see org.apache.jackrabbit.webdav.version.VersionControlledResource#checkout()
      */
+    @Override
     public void checkout() throws DavException {
         if (!exists()) {
             throw new DavException(DavServletResponse.SC_NOT_FOUND);
@@ -347,6 +350,7 @@ public class VersionControlledItemCollec
      * @throws org.apache.jackrabbit.webdav.DavException
      * @see org.apache.jackrabbit.webdav.version.VersionControlledResource#uncheckout()
      */
+    @Override
     public void uncheckout() throws DavException {
         throw new DavException(DavServletResponse.SC_NOT_IMPLEMENTED);
     }
@@ -370,6 +374,7 @@ public class VersionControlledItemCollec
      * @see org.apache.jackrabbit.webdav.version.VersionControlledResource#update(org.apache.jackrabbit.webdav.version.UpdateInfo)
      */
     //TODO: with jcr the node must not be versionable in order to perform Node.update.
+    @Override
     public MultiStatus update(UpdateInfo updateInfo) throws DavException {
         if (updateInfo == null) {
             throw new DavException(DavServletResponse.SC_BAD_REQUEST, "Valid update request
body required.");
@@ -447,6 +452,7 @@ public class VersionControlledItemCollec
      * @see Node#merge(String, boolean)
      */
     //TODO: with jcr the node must not be versionable in order to perform Node.merge
+    @Override
     public MultiStatus merge(MergeInfo mergeInfo) throws DavException {
         if (mergeInfo == null) {
             throw new DavException(DavServletResponse.SC_BAD_REQUEST);
@@ -493,6 +499,7 @@ public class VersionControlledItemCollec
      * @see VersionHistory#addVersionLabel(String, String, boolean)
      * @see VersionHistory#removeVersionLabel(String)
      */
+    @Override
     public void label(LabelInfo labelInfo) throws DavException {
         if (labelInfo == null) {
             throw new DavException(DavServletResponse.SC_BAD_REQUEST, "Valid label request
body required.");
@@ -525,6 +532,7 @@ public class VersionControlledItemCollec
      * @see org.apache.jackrabbit.webdav.version.VersionControlledResource#getVersionHistory()
      * @see javax.jcr.Node#getVersionHistory()
      */
+    @Override
     public VersionHistoryResource getVersionHistory() throws DavException {
         if (!exists()) {
             throw new DavException(DavServletResponse.SC_NOT_FOUND);

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java?rev=1640344&r1=1640343&r2=1640344&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
Tue Nov 18 13:50:59 2014
@@ -144,6 +144,7 @@ public class WorkspaceResourceImpl exten
 
     //--------------------------------------------------------< DavResource >---
 
+    @Override
     public String getSupportedMethods() {
         StringBuilder sb = new StringBuilder(DavResource.METHODS);
         sb.append(", ");
@@ -161,6 +162,7 @@ public class WorkspaceResourceImpl exten
      * present in the list of available workspace names such as exposed by
      * the editing JCR session.
      */
+    @Override
     public boolean exists() {
         try {
             List<String> available = Arrays.asList(getRepositorySession().getWorkspace().getAccessibleWorkspaceNames());
@@ -174,6 +176,7 @@ public class WorkspaceResourceImpl exten
     /**
      * @return true
      */
+    @Override
     public boolean isCollection() {
         return true;
     }
@@ -185,6 +188,7 @@ public class WorkspaceResourceImpl exten
      * @see org.apache.jackrabbit.webdav.DavResource#getDisplayName()
      * @see javax.jcr.Workspace#getName()
      */
+    @Override
     public String getDisplayName() {
         return getLocator().getWorkspaceName();
     }
@@ -194,6 +198,7 @@ public class WorkspaceResourceImpl exten
      *
      * @return
      */
+    @Override
     public long getModificationTime() {
         return new Date().getTime();
     }
@@ -202,6 +207,7 @@ public class WorkspaceResourceImpl exten
      * @param outputContext
      * @throws IOException
      */
+    @Override
     public void spool(OutputContext outputContext) throws IOException {
 
         outputContext.setProperty("Link", "<?" + EventJournalResourceImpl.RELURIFROMWORKSPACE
@@ -255,6 +261,7 @@ public class WorkspaceResourceImpl exten
      *
      * @see org.apache.jackrabbit.webdav.DavResource#getCollection()
      */
+    @Override
     public DavResource getCollection() {
         DavResource collection = null;
         // create location with 'null' values for workspace-path and resource-path
@@ -274,6 +281,7 @@ public class WorkspaceResourceImpl exten
      * @param inputContext
      * @throws DavException
      */
+    @Override
     public void addMember(DavResource resource, InputContext inputContext) throws DavException
{
         log.error("Cannot add a new member to the workspace resource.");
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
@@ -284,6 +292,7 @@ public class WorkspaceResourceImpl exten
      *
      * @return
      */
+    @Override
     public DavResourceIterator getMembers() {
         try {
             DavResourceLocator loc = getLocatorFromItem(getRepositorySession().getRootNode());
@@ -304,6 +313,7 @@ public class WorkspaceResourceImpl exten
      * @param member
      * @throws DavException
      */
+    @Override
     public void removeMember(DavResource member) throws DavException {
         log.error("Cannot add a remove the root node.");
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
@@ -441,6 +451,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public void addVersionControl() throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -450,6 +461,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public String checkin() throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -458,6 +470,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public void checkout() throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -466,6 +479,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public void uncheckout() throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -484,6 +498,7 @@ public class WorkspaceResourceImpl exten
      * @throws org.apache.jackrabbit.webdav.DavException
      * @see org.apache.jackrabbit.webdav.version.VersionControlledResource#update(org.apache.jackrabbit.webdav.version.UpdateInfo)
      */
+    @Override
     public MultiStatus update(UpdateInfo updateInfo) throws DavException {
         if (updateInfo == null) {
             throw new DavException(DavServletResponse.SC_BAD_REQUEST, "Valid update request
body required.");
@@ -533,6 +548,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public MultiStatus merge(MergeInfo mergeInfo) throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -541,6 +557,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public void label(LabelInfo labelInfo) throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }
@@ -549,6 +566,7 @@ public class WorkspaceResourceImpl exten
      * @throws DavException (403) since workspace is not versionable. implementing
      * <code>VersionControlledResource</code> only for 'update'.
      */
+    @Override
     public VersionHistoryResource getVersionHistory() throws DavException {
         throw new DavException(DavServletResponse.SC_FORBIDDEN);
     }



Mime
View raw message