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 @SuppressWarnings("unused")
031 public int copyCollectionResource(
032 WebDAVRequest webDavRequest, Resource resource, String destination,
033 boolean overwrite, long depth)
034 throws WebDAVException {
035
036 return HttpServletResponse.SC_FORBIDDEN;
037 }
038
039 @SuppressWarnings("unused")
040 public int copySimpleResource(
041 WebDAVRequest webDavRequest, Resource resource, String destination,
042 boolean overwrite)
043 throws WebDAVException {
044
045 return HttpServletResponse.SC_FORBIDDEN;
046 }
047
048 @SuppressWarnings("unused")
049 public int deleteResource(WebDAVRequest webDavRequest)
050 throws WebDAVException {
051
052 return HttpServletResponse.SC_FORBIDDEN;
053 }
054
055 public String getRootPath() {
056 return _rootPath;
057 }
058
059 public String getToken() {
060 return _token;
061 }
062
063 public boolean isAvailable(WebDAVRequest webDavRequest)
064 throws WebDAVException {
065
066 if (getResource(webDavRequest) == null) {
067 return false;
068 }
069 else {
070 return true;
071 }
072 }
073
074 public boolean isSupportsClassTwo() {
075 return false;
076 }
077
078 @SuppressWarnings("unused")
079 public Status lockResource(
080 WebDAVRequest webDavRequest, String owner, long timeout)
081 throws WebDAVException {
082
083 return null;
084 }
085
086 @SuppressWarnings("unused")
087 public Status makeCollection(WebDAVRequest webDavRequest)
088 throws WebDAVException {
089
090 return new Status(HttpServletResponse.SC_FORBIDDEN);
091 }
092
093 @SuppressWarnings("unused")
094 public int moveCollectionResource(
095 WebDAVRequest webDavRequest, Resource resource, String destination,
096 boolean overwrite)
097 throws WebDAVException {
098
099 return HttpServletResponse.SC_FORBIDDEN;
100 }
101
102 @SuppressWarnings("unused")
103 public int moveSimpleResource(
104 WebDAVRequest webDavRequest, Resource resource, String destination,
105 boolean overwrite)
106 throws WebDAVException {
107
108 return HttpServletResponse.SC_FORBIDDEN;
109 }
110
111 @SuppressWarnings("unused")
112 public int putResource(WebDAVRequest webDavRequest) throws WebDAVException {
113 return HttpServletResponse.SC_FORBIDDEN;
114 }
115
116 @SuppressWarnings("unused")
117 public Lock refreshResourceLock(
118 WebDAVRequest webDavRequest, String uuid, long timeout)
119 throws WebDAVException {
120
121 return null;
122 }
123
124 public void setRootPath(String rootPath) {
125 _rootPath = rootPath;
126 }
127
128 public void setToken(String token) {
129 _token = token;
130 }
131
132 @SuppressWarnings("unused")
133 public boolean unlockResource(WebDAVRequest webDavRequest, String token)
134 throws WebDAVException {
135
136 return false;
137 }
138
139 protected long getPlid(long groupId) throws SystemException {
140 return LayoutLocalServiceUtil.getDefaultPlid(groupId);
141 }
142
143 protected boolean isAddGroupPermissions(long groupId) throws Exception {
144 Group group = GroupLocalServiceUtil.getGroup(groupId);
145
146 if (!group.isUser()) {
147 return true;
148 }
149 else {
150 return false;
151 }
152 }
153
154 private String _rootPath;
155 private String _token;
156
157 }