01: /*
02: * Copyright (c) 2000, 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: * a type to represent the three possible values of the depth attribute
27: */
28: public class Depth {
29: private String depth;
30: public static final Depth ZERO = new Depth("0");
31: public static final Depth ONE = new Depth("1");
32: public static final Depth INFINITY = new Depth("infinity");
33:
34: private Depth(String depth) {
35: this .depth = depth;
36: }
37:
38: public String toString() {
39: return depth;
40: }
41:
42: public static Depth getDepth(String depthStr) {
43: if (depthStr.equals("0"))
44: return Depth.ZERO;
45: else if (depthStr.equals("1"))
46: return Depth.ONE;
47: else if (depthStr.equals("infinity"))
48: return Depth.INFINITY;
49: return null;
50: }
51: }
52:
53: /* $Log: Depth.java,v $
54: /* Revision 1.5 2000/12/19 22:06:15 smulloni
55: /* adding documentation.
56: /*
57: /* Revision 1.4 2000/12/03 23:53:25 smulloni
58: /* added license and copyright preamble to java files.
59: /*
60: /* Revision 1.3 2000/11/09 23:34:52 smullyan
61: /* log added to every Java file, with the help of python. Lock stealing
62: /* implemented, and treatment of locks made more robust.
63: /* */
|