1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.plugin.webdav.resources.partial

File AbstractDavView.java

 

Coverage histogram

../../../../../../../img/srcFileCovDistChart7.png
64% of files have more coverage

Code metrics

4
11
7
1
91
55
9
0.82
1.57
7
1.29

Classes

Class Line # Actions
AbstractDavView 40 11 0% 9 8
0.636363663.6%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki.plugin.webdav.resources.partial;
21   
22    import java.io.IOException;
23   
24    import org.apache.jackrabbit.server.io.IOUtil;
25    import org.apache.jackrabbit.webdav.DavException;
26    import org.apache.jackrabbit.webdav.DavResource;
27    import org.apache.jackrabbit.webdav.DavServletResponse;
28    import org.apache.jackrabbit.webdav.io.InputContext;
29    import org.apache.jackrabbit.webdav.io.OutputContext;
30   
31    import com.xpn.xwiki.plugin.webdav.resources.domain.DavTempFile;
32   
33   
34    /**
35    * A view represents a collection of webdav resources, usually a view is a logical grouping of
36    * resources (pages, spaces etc.).
37    *
38    * @version $Id: 3213b370d96b3b9a4152358c567ad6cba3c02e88 $
39    */
 
40    public abstract class AbstractDavView extends AbstractDavResource
41    {
 
42  17 toggle @Override
43    public boolean exists()
44    {
45  17 return true;
46    }
47   
 
48  0 toggle @Override
49    public long getModificationTime()
50    {
51  0 return IOUtil.UNDEFINED_TIME;
52    }
53   
 
54  216 toggle @Override
55    public boolean isCollection()
56    {
57  216 return true;
58    }
59   
 
60  0 toggle @Override
61    public void move(DavResource destination) throws DavException
62    {
63  0 throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
64    }
65   
 
66  0 toggle @Override
67    public void spool(OutputContext outputContext) throws IOException
68    {
69  0 throw new IOException("Views cannot be spooled.");
70    }
71   
 
72  4 toggle @Override
73    public void addMember(DavResource resource, InputContext inputContext) throws DavException
74    {
75  4 if (resource instanceof DavTempFile) {
76  4 addVirtualMember(resource, inputContext);
77    } else {
78  0 throw new DavException(DavServletResponse.SC_FORBIDDEN);
79    }
80    }
81   
 
82  9 toggle @Override
83    public void removeMember(DavResource member) throws DavException
84    {
85  9 if (member instanceof DavTempFile) {
86  4 removeVirtualMember(member);
87    } else {
88  5 throw new DavException(DavServletResponse.SC_FORBIDDEN);
89    }
90    }
91    }