001
014
015 package com.liferay.portal.kernel.webdav;
016
017 import com.liferay.portal.kernel.exception.SystemException;
018 import com.liferay.portal.model.Group;
019 import com.liferay.portal.model.Lock;
020 import com.liferay.portal.service.GroupLocalServiceUtil;
021 import com.liferay.portal.service.LayoutLocalServiceUtil;
022
023 import javax.servlet.http.HttpServletResponse;
024
025
028 public abstract class BaseWebDAVStorageImpl implements WebDAVStorage {
029
030
033 public int copyCollectionResource(
034 WebDAVRequest webDavRequest, Resource resource, String destination,
035 boolean overwrite, long depth)
036 throws WebDAVException {
037
038 return HttpServletResponse.SC_FORBIDDEN;
039 }
040
041
044 public int copySimpleResource(
045 WebDAVRequest webDavRequest, Resource resource, String destination,
046 boolean overwrite)
047 throws WebDAVException {
048
049 return HttpServletResponse.SC_FORBIDDEN;
050 }
051
052
055 public int deleteResource(WebDAVRequest webDavRequest)
056 throws WebDAVException {
057
058 return HttpServletResponse.SC_FORBIDDEN;
059 }
060
061 public String getRootPath() {
062 return _rootPath;
063 }
064
065 public String getToken() {
066 return _token;
067 }
068
069 public boolean isAvailable(WebDAVRequest webDavRequest)
070 throws WebDAVException {
071
072 if (getResource(webDavRequest) == null) {
073 return false;
074 }
075 else {
076 return true;
077 }
078 }
079
080 public boolean isSupportsClassTwo() {
081 return false;
082 }
083
084
087 public Status lockResource(
088 WebDAVRequest webDavRequest, String owner, long timeout)
089 throws WebDAVException {
090
091 return null;
092 }
093
094
097 public Status makeCollection(WebDAVRequest webDavRequest)
098 throws WebDAVException {
099
100 return new Status(HttpServletResponse.SC_FORBIDDEN);
101 }
102
103
106 public int moveCollectionResource(
107 WebDAVRequest webDavRequest, Resource resource, String destination,
108 boolean overwrite)
109 throws WebDAVException {
110
111 return HttpServletResponse.SC_FORBIDDEN;
112 }
113
114
117 public int moveSimpleResource(
118 WebDAVRequest webDavRequest, Resource resource, String destination,
119 boolean overwrite)
120 throws WebDAVException {
121
122 return HttpServletResponse.SC_FORBIDDEN;
123 }
124
125
128 public int putResource(WebDAVRequest webDavRequest) throws WebDAVException {
129 return HttpServletResponse.SC_FORBIDDEN;
130 }
131
132
135 public Lock refreshResourceLock(
136 WebDAVRequest webDavRequest, String uuid, long timeout)
137 throws WebDAVException {
138
139 return null;
140 }
141
142 public void setRootPath(String rootPath) {
143 _rootPath = rootPath;
144 }
145
146 public void setToken(String token) {
147 _token = token;
148 }
149
150
153 public boolean unlockResource(WebDAVRequest webDavRequest, String token)
154 throws WebDAVException {
155
156 return false;
157 }
158
159 protected long getPlid(long groupId) throws SystemException {
160 return LayoutLocalServiceUtil.getDefaultPlid(groupId);
161 }
162
163 protected boolean isAddCommunityPermissions(long groupId) throws Exception {
164 Group group = GroupLocalServiceUtil.getGroup(groupId);
165
166 if (!group.isUser()) {
167 return true;
168 }
169 else {
170 return false;
171 }
172 }
173
174 private String _rootPath;
175 private String _token;
176
177 }