01: /*
02: * Copyright (c) 2001, Jacob Smullyan.
03: *
04: * This is part of SkunkDAV, a WebDAV client. See http://skunkdav.sourceforge.net/
05: * for the latest version.
06: *
07: * SkunkDAV is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License as published
09: * by the Free Software Foundation; either version 2, or (at your option)
10: * any later version.
11: *
12: * SkunkDAV is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with SkunkDAV; see the file COPYING. If not, write to the Free
19: * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20: * 02111-1307, USA.
21: */
22:
23: package org.skunk.dav.client;
24:
25: /**
26: * an abstract class for DAVMethods that represent write operations
27: * (PUT, MKCOL, POST, DELETE, PROPPATCH) that require If: headers
28: * to operate on locked resources
29: */
30: public abstract class AbstractWriteDAVMethod extends AbstractDAVMethod {
31: private IfHeader ifHeader = null;
32: private String lockToken = null;
33:
34: public AbstractWriteDAVMethod(String path) {
35: super (path);
36: }
37:
38: public final IfHeader getIfHeader() {
39: return this .ifHeader;
40: }
41:
42: public final void setIfHeader(IfHeader ifHeader) {
43: this .ifHeader = ifHeader;
44: }
45:
46: public void processRequestHeaders() {
47: if (ifHeader != null && !ifHeader.isEmpty()) {
48: getRequestHeaders().put(DAVConstants.IF_HEADER,
49: ifHeader.toString());
50: }
51: }
52: }
|