blob: 3e5508e41f8d2891dde5c636b26de25baace8c49 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
package org.eclipse.team.internal.ccvs.core;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.io.InputStream;
import java.util.Date;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
/**
* The CVS analog of a file. CVS files have access to synchronization information
* that describes their association with the CVS repository. CVS files also provide
* mechanisms for sending and receiving content.
*
* @see ICVSResource
*/
public interface ICVSFile extends ICVSResource {
// Constants used to indicate the type of updated response from the server
public static final int UPDATED = 1;
public static final int MERGED = 2;
public static final int UPDATE_EXISTING = 3;
public static final int CREATED = 4;
/**
* Answers the size of the file.
*/
long getSize();
/**
* Gets an input stream for reading from the file.
* It is the responsibility of the caller to close the stream when finished.
*/
InputStream getContents() throws CVSException;
/**
* Set the contents of the file to the contents of the provided input stream
*
* @param responseType the type of reponse that was received from the server
*
* UPDATED - could be a new file or an existing file
* MERGED - merging remote changes with local changes. Failure could result in loss of local changes
* CREATED - contents for a file that doesn't exist locally
* UPDATE_EXISTING - Replacing a local file with no local changes with remote changes.
*/
public void setContents(InputStream stream, int responseType, boolean keepLocalHistory, IProgressMonitor monitor) throws CVSException;
/**
* Sets the file's read-only permission.
*/
void setReadOnly(boolean readOnly) throws CVSException;
/**
* Answers if the file is read-only.
*/
boolean isReadOnly() throws CVSException;
/**
* Move the resource to another location. Does overwrite without
* promting.
*/
void copyTo(String filename) throws CVSException;
/**
* Answers the current timestamp for this file with second precision.
*/
Date getTimeStamp();
/**
* If the date is <code>null</code> then the current time is used.
*/
void setTimeStamp(Date date) throws CVSException;
/**
* Answers <code>true</code> if the file has changed since it was last updated
* from the repository, if the file does not exist, or is not managed. And <code>false</code>
* if it has not changed.
*/
boolean isModified() throws CVSException;
/**
* Answers the revision history for this file. This is similar to the
* output of the log command.
*/
public ILogEntry[] getLogEntries(IProgressMonitor monitor) throws TeamException;
}
|