KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > webdav > impl > NamespaceManager


1 package com.ibm.webdav.impl;
2
3 /*
4  * (C) Copyright IBM Corp. 2000 All rights reserved.
5  *
6  * The program is provided "AS IS" without any warranty express or
7  * implied, including the warranty of non-infringement and the implied
8  * warranties of merchantibility and fitness for a particular purpose.
9  * IBM will not be liable for any damages suffered by you as a result
10  * of using the Program. In no event will IBM be liable for any
11  * special, indirect or consequential damages or lost profits even if
12  * IBM has been advised of the possibility of their occurrence. IBM
13  * will not be liable for any third party claims against you.
14  *
15  * Portions Copyright (C) Simulacra Media Ltd, 2004.
16  */

17 import java.io.*;
18 import java.net.*;
19 import java.util.*;
20
21 import org.w3c.dom.*;
22
23 import com.ibm.webdav.*;
24
25 /** NamespaceManager implements all WebDAV namespace methods that are
26  * dependent on a specific repository manager interface. This manager is
27  * used by ResourceImpl and its subclasses to interface with a particular
28  * repository manager for accessing and controlling resources. Implementing
29  * this interface along with PropertiesManager and LockManager is all that
30  * is needed to provide WebDAV access to a particular repository manager.
31  * @author Jim Amsden <jamsden@us.ibm.com>
32  */

33 public interface NamespaceManager {
34 /** Close any opened OutputStream on the contents of the managed resource.
35 * @exception com.ibm.webdav.WebDAVException
36 */

37 public void closeContentsOutputStream() throws WebDAVException;
38 /** Create a collection with the given local name.
39 * @param localName the repository specific local name for the resource
40 * @exception com.ibm.webdav.WebDAVException
41 */

42 public void createCollection(String JavaDoc localName) throws WebDAVException;
43 /** Create this resource as a lock-null resource, a resource created by locking one that
44 * did not previously exist.
45 * @exception com.ibm.webdav.WebDAVException
46 */

47 public void createLockNullResource() throws WebDAVException;
48 /** Delete the managed resource from the repository.
49 * @exception com.ibm.webdav.WebDAVException
50 */

51 public void delete() throws WebDAVException;
52 /**
53  * Create new binding
54  * @param path
55  * @throws WebDAVException
56  */

57 public void createBinding(String JavaDoc bindName,URL source) throws WebDAVException;
58
59 /** Move the managed resource
60 * @exception com.ibm.webdav.WebDAVException
61 */

62 public void move(String JavaDoc path) throws WebDAVException;
63 /** See if this resource exists in the repository.
64 *
65 * @return true if the resource exists, false otherwise.
66 * @exception com.ibm.webdav.WebDAVException
67 */

68 public boolean exists() throws WebDAVException;
69 /** Open an InputStream on the contents of the managed resource.
70 *
71 * @return an InputStream on the contents of the managed resource.
72 * @exception com.ibm.webdav.WebDAVException
73 */

74 public InputStream getContentsInputStream() throws WebDAVException;
75 /** Open an OutputStream in order to write the contents of the managed resource.
76 *
77 * @return an OutputStream on the contents of the managed resource.
78 * @exception com.ibm.webdav.WebDAVException
79 */

80 public OutputStream getContentsOutputStream() throws WebDAVException;
81 /** Get the members of a collection.
82 *
83 * @return a Vector of Resources (ResourceImpl or CollectionImpl)
84 * @exception com.ibm.webdav.WebDAVException
85 */

86 public Vector getMembers() throws WebDAVException;
87 /** Initialize this NamespaceManager instance.
88 * @param resource the resource to manage
89 */

90 public void initialize(ResourceImpl resource);
91 /** Is the managed resource a collection?
92 * @return true if this resource is a collection, false otherwise
93 * @exception com.ibm.webdav.WebDAVException
94 */

95 public boolean isCollection() throws WebDAVException;
96 /**
97  * Is the managed resource versionable?
98  *
99  * @return
100  * @throws WebDAVException
101  */

102 public boolean isVersionable() throws WebDAVException;
103 /** Is this resource in the lock-null state?
104 * @return true if this resource is a lock-null resource, false otherwise
105 * @exception com.ibm.webdav.WebDAVException
106 */

107 public boolean isLockNull() throws WebDAVException;
108 /** Treat the managed resource as a method and execute it with the given arguments.
109 * Ths should be done by the host Web server. Executes CGI scripts and Servlets. But
110 * the repository may have some additional capabilities of its own.
111 * @param args the URL query string (text following the ?)
112 * @return the contents of the result
113 * @exception com.ibm.webdav.WebDAVException
114 */

115 public byte[] performWith(String JavaDoc args) throws WebDAVException;
116
117 /**
118  * Returns a list of methods allowed on this resource
119  *
120  * @return
121  * @throws WebDAVException
122  */

123 public List getAllowedMethods() throws WebDAVException;
124 /**
125  * Sets the ordering of members within collection
126  *
127  * @param orderPatch
128  */

129 public void setOrdering(Document orderPatch) throws WebDAVException;
130 /**
131  * @return
132  */

133 public String JavaDoc getContentType() throws WebDAVException;
134 /**
135  * @param sContentType
136  */

137 public void closeContentsOutputStream(String JavaDoc sContentType) throws WebDAVException;
138
139 }
140
Popular Tags