1
22
23 package com.liferay.portal.webdav;
24
25 import com.liferay.portal.SystemException;
26 import com.liferay.portal.model.Lock;
27 import com.liferay.portal.service.LayoutLocalServiceUtil;
28
29 import javax.servlet.http.HttpServletResponse;
30
31
36 public abstract class BaseWebDAVStorageImpl implements WebDAVStorage {
37
38 @SuppressWarnings("unused")
39 public int copyCollectionResource(
40 WebDAVRequest webDavRequest, Resource resource, String destination,
41 boolean overwrite, long depth)
42 throws WebDAVException {
43
44 return HttpServletResponse.SC_FORBIDDEN;
45 }
46
47 @SuppressWarnings("unused")
48 public int copySimpleResource(
49 WebDAVRequest webDavRequest, Resource resource, String destination,
50 boolean overwrite)
51 throws WebDAVException {
52
53 return HttpServletResponse.SC_FORBIDDEN;
54 }
55
56 @SuppressWarnings("unused")
57 public int deleteResource(WebDAVRequest webDavRequest)
58 throws WebDAVException {
59
60 return HttpServletResponse.SC_FORBIDDEN;
61 }
62
63 public String getRootPath() {
64 return _rootPath;
65 }
66
67 public String getToken() {
68 return WebDAVUtil.getStorageToken(getClass().getName());
69 }
70
71 public boolean isAvailable(WebDAVRequest webDavRequest)
72 throws WebDAVException {
73
74 if (getResource(webDavRequest) == null) {
75 return false;
76 }
77 else {
78 return true;
79 }
80 }
81
82 public boolean isSupportsClassTwo() {
83 return false;
84 }
85
86 @SuppressWarnings("unused")
87 public Status lockResource(
88 WebDAVRequest webDavRequest, String owner, long timeout)
89 throws WebDAVException {
90
91 return null;
92 }
93
94 @SuppressWarnings("unused")
95 public Status makeCollection(WebDAVRequest webDavRequest)
96 throws WebDAVException {
97
98 return new Status(HttpServletResponse.SC_FORBIDDEN);
99 }
100
101 @SuppressWarnings("unused")
102 public int moveCollectionResource(
103 WebDAVRequest webDavRequest, Resource resource, String destination,
104 boolean overwrite)
105 throws WebDAVException {
106
107 return HttpServletResponse.SC_FORBIDDEN;
108 }
109
110 @SuppressWarnings("unused")
111 public int moveSimpleResource(
112 WebDAVRequest webDavRequest, Resource resource, String destination,
113 boolean overwrite)
114 throws WebDAVException {
115
116 return HttpServletResponse.SC_FORBIDDEN;
117 }
118
119 @SuppressWarnings("unused")
120 public int putResource(WebDAVRequest webDavRequest) throws WebDAVException {
121 return HttpServletResponse.SC_FORBIDDEN;
122 }
123
124 @SuppressWarnings("unused")
125 public Lock refreshResourceLock(
126 WebDAVRequest webDavRequest, String uuid, long timeout)
127 throws WebDAVException {
128
129 return null;
130 }
131
132 public void setRootPath(String rootPath) {
133 _rootPath = rootPath;
134 }
135
136 @SuppressWarnings("unused")
137 public boolean unlockResource(WebDAVRequest webDavRequest, String token)
138 throws WebDAVException {
139
140 return false;
141 }
142
143 protected long getPlid(long groupId) throws SystemException {
144 return LayoutLocalServiceUtil.getDefaultPlid(groupId);
145 }
146
147 private String _rootPath;
148
149 }