KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > variants > IResourceVariant


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.core.variants;
12
13 import org.eclipse.core.resources.IStorage;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.team.core.TeamException;
16
17 /**
18  * This interface is used by <code>SyncInfo</code> instances
19  * to provide access to the base and remote resources that correspond to
20  * a local resource.
21  *
22  * @see org.eclipse.team.core.synchronize.SyncInfo
23  * @since 3.0
24  */

25 public interface IResourceVariant {
26     
27     /**
28      * Answers the name of the remote resource. The name may be
29      * displayed to the user.
30      *
31      * @return name of the resource variant.
32      */

33     public String JavaDoc getName();
34     
35     /**
36      * Answers if the remote resource may have children.
37      *
38      * @return <code>true</code> if the remote resource may have children and
39      * <code>false</code> otherwise.
40      */

41     public boolean isContainer();
42     
43     /**
44      * Return an instance of IStorage or <code>null</code> if the remote resource
45      * does not have contents (i.e. is a folder). Since the <code>ISorage#getContents()</code>
46      * method does not accept an <code>IProgressMonitor</code>, this method must ensure that the contents
47      * access by the resulting <code>IStorage</code> is cached locally (hence the <code>IProgressMonitor</code>
48      * argument to this method). Implementations of this method should
49      * ensure that the resulting <code>IStorage</code> is accessing locally cached contents and is not
50      * contacting the server.
51      * <p>
52      * The returned storage object may be an instance of (@link org.eclipse.core.resources.IEncodedStorage}
53      * in which case clients can determine the character encoding of the contents.
54      * @param monitor a progress monitor
55      *
56      * @return an <code>IStorage</code> that provides access to the contents of
57      * the remote resource or <code>null</code> if the remote resource is a container.
58      * @throws TeamException
59      */

60     public IStorage getStorage(IProgressMonitor monitor) throws TeamException;
61     
62     /**
63      * Return a content identifier that is used to differentiate versions
64      * or revisions of the same resource.
65      *
66      * @return a String that identifies the version of the subscriber resource
67      */

68     public String JavaDoc getContentIdentifier();
69     
70     /**
71      * Return an array of bytes that can be used to uniquely identify this
72      * resource variant when compared to other resource variants and could
73      * also potentially be used to recreate a resource variant handle.
74      * @return the bytes that uniquely identify this resource variant
75      */

76     public byte[] asBytes();
77     
78     /**
79      * Returns whether the remote resource is equal to the provided object.
80      * @param object the object to be compared
81      * @return whether the object is equal to the remote resource
82      */

83     public boolean equals(Object JavaDoc object);
84
85 }
86
Popular Tags