KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > ICVSStorage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.core;
12
13 import java.io.InputStream JavaDoc;
14
15 import org.eclipse.core.runtime.IProgressMonitor;
16
17 /**
18  * This interface is used by the Session to transfer file contents.
19  * It is used for regular files in a local sandbox as well as special files
20  * such as the CVS/Template file.
21  */

22 public interface ICVSStorage {
23
24     /**
25      * Return the name for this ICVSStorage.
26      * @return
27      */

28     String JavaDoc getName();
29     
30     /**
31      * Set the contents of the file to the contents of the provided input stream.
32      *
33      * This method is used by the command framework and should not be used by other clients.
34      * Other clients should set the contents of the underlying <code>IFile</code> which
35      * can be obtained using <code>getIResource()</code>.
36      *
37      * @param responseType the type of reponse that was received from the server
38      *
39      * UPDATED - could be a new file or an existing file
40      * MERGED - merging remote changes with local changes. Failure could result in loss of local changes
41      * CREATED - contents for a file that doesn't exist locally
42      * UPDATE_EXISTING - Replacing a local file with no local changes with remote changes.
43      */

44     public void setContents(InputStream JavaDoc stream, int responseType, boolean keepLocalHistory, IProgressMonitor monitor) throws CVSException;
45
46     /**
47      * Answers the size of the file.
48      */

49     long getSize();
50     
51     /**
52      * Gets an input stream for reading from the file.
53      * It is the responsibility of the caller to close the stream when finished.
54      */

55     InputStream JavaDoc getContents() throws CVSException;
56     
57 }
58
Popular Tags