KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > vfs > AbstractVersioningVFS


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.vfs;
20
21 import java.net.URI JavaDoc;
22
23 import org.openharmonise.vfs.authentication.*;
24 import org.openharmonise.vfs.status.*;
25
26
27 /**
28  * This is the abstract class from which all Virtual File Systems which
29  * implement versioning features should extend.
30  *
31  * @author Matthew Large
32  * @version $Revision: 1.1 $
33  *
34  */

35 public abstract class AbstractVersioningVFS extends AbstractVirtualFileSystem {
36
37     /**
38      * @param uri URI to locate the file system to be connected to
39      */

40     public AbstractVersioningVFS(URI JavaDoc uri) {
41         super(uri);
42     }
43
44     /**
45      * @param uri URI to locate the file system to be connected to
46      * @param authInfo Authentication information for the file system to be connected to
47      */

48     public AbstractVersioningVFS(URI JavaDoc uri, AuthInfo authInfo) {
49         super(uri, authInfo);
50     }
51
52     /**
53      * @param uri URI to locate the file system to be connected to
54      * @param authStore Authentication store to use to lookup authentication information for the file system to be connected to
55      */

56     public AbstractVersioningVFS(URI JavaDoc uri, AbstractAuthenticationStore authStore) {
57         super(uri, authStore);
58     }
59     
60     /**
61      * Checks out a new version of the virtual file
62      *
63      * @param sFullPath Full path to the file to be checked out
64      * @return true if the method was successful
65      */

66     public abstract StatusData checkoutVirtualFile(String JavaDoc sFullPath);
67     
68     /**
69      * Unchecks out the virtual file
70      *
71      * @param sFullPath Full path to the file to be unchecked out
72      * @return true if the method was successful
73      */

74     public abstract StatusData uncheckoutVirtualFile(String JavaDoc sFullPath);
75     
76     /**
77      * Checks in the virtual file making this the current version
78      *
79      * @param sFullPath Full path to the file to be checked in
80      * @return true if the method was successful
81      */

82     public abstract StatusData checkinVirtualFile(String JavaDoc sFullPath);
83     
84     /**
85      * Tags a virtual file
86      *
87      * @param sFullPath Full path to the file to be tagged
88      * @param sTag Tag to put in file
89      * @return true if the method was successful
90      */

91     public abstract StatusData tagVirtualFile(String JavaDoc sFullPath, String JavaDoc sTag);
92     
93     /**
94      * Reactives a version of a virtual file to be the current checked out virtual file.
95      * This will fail if there is already a checked out version.
96      *
97      * @param sFullPath Full path to the version to be reactived
98      * @return true if the method was successful
99      */

100     public abstract StatusData reactivateVersion(String JavaDoc sFullPath);
101     
102     /**
103      * Populates the list of historical versions for a virtual file. These
104      * are typically not populated when a virtual file is first fetched.
105      *
106      * @param vfFile Virtual file to have its history populated
107      */

108     protected abstract void fullyPopulateFileHistory(VersionedVirtualFile vfFile);
109
110     /**
111      * Provides access to the {@link VersionedVirtualFile#setHistoryPopulated(boolean)} method.
112      *
113      * @param vfFile Virtual file to be used
114      * @param bHistoryPopulated true to set the virtual file's history as populated
115      */

116     protected void setFileHistoryPopulated(VersionedVirtualFile vfFile, boolean bHistoryPopulated) {
117         vfFile.setHistoryPopulated(bHistoryPopulated);
118     }
119     
120     /**
121      * Provides access to the {@link VersionedVirtualFile#addHistoricalVersion(String)} method.
122      *
123      * @param vfFile Virtual file to be used
124      * @param sPath Path to add to history
125      */

126     protected void addHistoricalVersionPath(VersionedVirtualFile vfFile, String JavaDoc sPath) {
127         vfFile.addHistoricalVersion(sPath);
128     }
129     
130     /**
131      * Provides access to the {@link VersionedVirtualFile#setPendingVersionPath(String)} method.
132      *
133      * @param vfFile Virtual file to be used
134      * @param sPath Path to be set as the pending version path
135      */

136     protected void setFilePendingVersionPath(VersionedVirtualFile vfFile, String JavaDoc sPath) {
137         vfFile.setPendingVersionPath(sPath);
138     }
139     
140     /**
141      * Provides access to the {@link VersionedVirtualFile#setLiveVersionPath(String)} method.
142      *
143      * @param vfFile Virtual file to be used
144      * @param sPath Path to be set as the live version path
145      */

146     protected void setFileLiveVersionPath(VersionedVirtualFile vfFile, String JavaDoc sPath) {
147         vfFile.setLiveVersionPath(sPath);
148     }
149 }
150
Popular Tags