KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > resources > IResource


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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  * Red Hat Incorporated - get/setResourceAttribute code
11  *******************************************************************************/

12 package org.eclipse.core.resources;
13
14 import java.net.URI JavaDoc;
15 import org.eclipse.core.runtime.*;
16 import org.eclipse.core.runtime.jobs.ISchedulingRule;
17
18 /**
19  * The workspace analog of file system files
20  * and directories. There are exactly four <i>types</i> of resource:
21  * files, folders, projects and the workspace root.
22  * <p>
23  * File resources are similar to files in that they
24  * hold data directly. Folder resources are analogous to directories in that they
25  * hold other resources but cannot directly hold data. Project resources
26  * group files and folders into reusable clusters. The workspace root is the
27  * top level resource under which all others reside.
28  * </p>
29  * <p>
30  * Features of resources:
31  * <ul>
32  * <li><code>IResource</code> objects are <i>handles</i> to state maintained
33  * by a workspace. That is, resource objects do not actually contain data
34  * themselves but rather represent resource state and give it behavior. Programmers
35  * are free to manipulate handles for resources that do not exist in a workspace
36  * but must keep in mind that some methods and operations require that an actual
37  * resource be available.</li>
38  * <li>Resources have two different kinds of properties as detailed below. All
39  * properties are keyed by qualified names.</li>
40  * <ul>
41  * <li>Session properties: Session properties live for the lifetime of one execution of
42  * the workspace. They are not stored on disk. They can carry arbitrary
43  * object values. Clients should be aware that these values are kept in memory
44  * at all times and, as such, the values should not be large.</li>
45  * <li>Persistent properties: Persistent properties have string values which are stored
46  * on disk across platform sessions. The value of a persistent property is a
47  * string which should be short (i.e., under 2KB). </li>
48  * </ul>
49  * </li>
50  * <li>Resources are identified by type and by their <i>path</i>, which is similar to a file system
51  * path. The name of a resource is the last segment of its path. A resource's parent
52  * is located by removing the last segment (the resource's name) from the resource's full path.</li>
53  * <li>Resources can be local or non-local. A non-local resource is one whose
54  * contents and properties have not been fetched from a repository.</li>
55  * <li><i>Phantom</i> resources represent incoming additions or outgoing deletions
56  * which have yet to be reconciled with a synchronization partner. </li>
57  * </ul>
58  * </p>
59  * <p>
60  * This interface is not intended to be implemented by clients.
61  * </p>
62  * <p>
63  * Resources implement the <code>IAdaptable</code> interface;
64  * extensions are managed by the platform's adapter manager.
65  * </p>
66  *
67  * @see IWorkspace
68  * @see Platform#getAdapterManager()
69  */

70 public interface IResource extends IAdaptable, ISchedulingRule {
71
72     /*====================================================================
73      * Constants defining resource types: There are four possible resource types
74      * and their type constants are in the integer range 1 to 8 as defined below.
75      *====================================================================*/

76
77     /**
78      * Type constant (bit mask value 1) which identifies file resources.
79      *
80      * @see IResource#getType()
81      * @see IFile
82      */

83     public static final int FILE = 0x1;
84
85     /**
86      * Type constant (bit mask value 2) which identifies folder resources.
87      *
88      * @see IResource#getType()
89      * @see IFolder
90      */

91     public static final int FOLDER = 0x2;
92
93     /**
94      * Type constant (bit mask value 4) which identifies project resources.
95      *
96      * @see IResource#getType()
97      * @see IProject
98      */

99     public static final int PROJECT = 0x4;
100
101     /**
102      * Type constant (bit mask value 8) which identifies the root resource.
103      *
104      * @see IResource#getType()
105      * @see IWorkspaceRoot
106      */

107     public static final int ROOT = 0x8;
108
109     /*====================================================================
110      * Constants defining the depth of resource tree traversal:
111      *====================================================================*/

112
113     /**
114      * Depth constant (value 0) indicating this resource, but not any of its members.
115      */

116     public static final int DEPTH_ZERO = 0;
117
118     /**
119      * Depth constant (value 1) indicating this resource and its direct members.
120      */

121     public static final int DEPTH_ONE = 1;
122
123     /**
124      * Depth constant (value 2) indicating this resource and its direct and
125      * indirect members at any depth.
126      */

127     public static final int DEPTH_INFINITE = 2;
128
129     /*====================================================================
130      * Constants for update flags for delete, move, copy, open, etc.:
131      *====================================================================*/

132
133     /**
134      * Update flag constant (bit mask value 1) indicating that the operation
135      * should proceed even if the resource is out of sync with the local file
136      * system.
137      *
138      * @since 2.0
139      */

140     public static final int FORCE = 0x1;
141
142     /**
143      * Update flag constant (bit mask value 2) indicating that the operation
144      * should maintain local history by taking snapshots of the contents of
145      * files just before being overwritten or deleted.
146      *
147      * @see IFile#getHistory(IProgressMonitor)
148      * @since 2.0
149      */

150     public static final int KEEP_HISTORY = 0x2;
151
152     /**
153      * Update flag constant (bit mask value 4) indicating that the operation
154      * should delete the files and folders of a project.
155      * <p>
156      * Deleting a project that is open ordinarily deletes all its files and folders,
157      * whereas deleting a project that is closed retains its files and folders.
158      * Specifying <code>ALWAYS_DELETE_PROJECT_CONTENT</code> indicates that the contents
159      * of a project are to be deleted regardless of whether the project is open or closed
160      * at the time; specifying <code>NEVER_DELETE_PROJECT_CONTENT</code> indicates that
161      * the contents of a project are to be retained regardless of whether the project
162      * is open or closed at the time.
163      * </p>
164      *
165      * @see #NEVER_DELETE_PROJECT_CONTENT
166      * @since 2.0
167      */

168     public static final int ALWAYS_DELETE_PROJECT_CONTENT = 0x4;
169
170     /**
171      * Update flag constant (bit mask value 8) indicating that the operation
172      * should preserve the files and folders of a project.
173      * <p>
174      * Deleting a project that is open ordinarily deletes all its files and folders,
175      * whereas deleting a project that is closed retains its files and folders.
176      * Specifying <code>ALWAYS_DELETE_PROJECT_CONTENT</code> indicates that the contents
177      * of a project are to be deleted regardless of whether the project is open or closed
178      * at the time; specifying <code>NEVER_DELETE_PROJECT_CONTENT</code> indicates that
179      * the contents of a project are to be retained regardless of whether the project
180      * is open or closed at the time.
181      * </p>
182      *
183      * @see #ALWAYS_DELETE_PROJECT_CONTENT
184      * @since 2.0
185      */

186     public static final int NEVER_DELETE_PROJECT_CONTENT = 0x8;
187
188     /**
189      * Update flag constant (bit mask value 16) indicating that the link creation
190      * should proceed even if the local file system file or directory is missing.
191      *
192      * @see IFolder#createLink(IPath, int, IProgressMonitor)
193      * @see IFile#createLink(IPath, int, IProgressMonitor)
194      * @since 2.1
195      */

196     public static final int ALLOW_MISSING_LOCAL = 0x10;
197
198     /**
199      * Update flag constant (bit mask value 32) indicating that a copy or move
200      * operation should only copy the link, rather than copy the underlying
201      * contents of the linked resource.
202      *
203      * @see #copy(IPath, int, IProgressMonitor)
204      * @see #move(IPath, int, IProgressMonitor)
205      * @since 2.1
206      */

207     public static final int SHALLOW = 0x20;
208
209     /**
210      * Update flag constant (bit mask value 64) indicating that setting the
211      * project description should not attempt to configure and de-configure
212      * natures.
213      *
214      * @see IProject#setDescription(IProjectDescription, int, IProgressMonitor)
215      * @since 3.0
216      */

217     public static final int AVOID_NATURE_CONFIG = 0x40;
218
219     /**
220      * Update flag constant (bit mask value 128) indicating that opening a
221      * project for the first time or creating a linked folder should refresh in the
222      * background.
223      *
224      * @see IProject#open(int, IProgressMonitor)
225      * @see IFolder#createLink(URI, int, IProgressMonitor)
226      * @since 3.1
227      */

228     public static final int BACKGROUND_REFRESH = 0x80;
229
230     /**
231      * Update flag constant (bit mask value 256) indicating that a
232      * resource should be replaced with a resource of the same name
233      * at a different file system location.
234      *
235      * @see IFile#createLink(URI, int, IProgressMonitor)
236      * @see IFolder#createLink(URI, int, IProgressMonitor)
237      * @see IResource#move(IProjectDescription, int, IProgressMonitor)
238      * @since 3.2
239      */

240     public static final int REPLACE = 0x100;
241
242     /**
243      * Update flag constant (bit mask value 512) indicating that ancestor
244      * resources of the target resource should be checked.
245      *
246      * @see IResource#isLinked(int)
247      * @since 3.2
248      */

249     public static final int CHECK_ANCESTORS = 0x200;
250
251     /**
252      * Update flag constant (bit mask value 0x400) indicating that a
253      * resource should be marked as derived.
254      *
255      * @see IFile#create(java.io.InputStream, int, IProgressMonitor)
256      * @see IFolder#create(int, boolean, IProgressMonitor)
257      * @see IResource#setDerived(boolean)
258      * @since 3.2
259      */

260     public static final int DERIVED = 0x400;
261
262     /**
263      * Update flag constant (bit mask value 0x800) indicating that a
264      * resource should be marked as team private.
265      *
266      * @see IFile#create(java.io.InputStream, int, IProgressMonitor)
267      * @see IFolder#create(int, boolean, IProgressMonitor)
268      * @see IResource#copy(IPath, int, IProgressMonitor)
269      * @see IResource#setTeamPrivateMember(boolean)
270      * @since 3.2
271      */

272     public static final int TEAM_PRIVATE = 0x800;
273
274     /*====================================================================
275      * Other constants:
276      *====================================================================*/

277
278     /**
279      * Modification stamp constant (value -1) indicating no modification stamp is
280      * available.
281      *
282      * @see #getModificationStamp()
283      */

284     public static final int NULL_STAMP = -1;
285
286     /**
287      * General purpose zero-valued bit mask constant. Useful whenever you need to
288      * supply a bit mask with no bits set.
289      * <p>
290      * Example usage:
291      * <code>
292      * <pre>
293      * delete(IResource.NONE, null)
294      * </pre>
295      * </code>
296      * </p>
297      *
298      * @since 2.0
299      */

300     public static final int NONE = 0;
301
302     /**
303      * Accepts the given visitor for an optimized traversal.
304      * The visitor's <code>visit</code> method is called, and is provided with a
305      * proxy to this resource. The proxy is a transient object that can be queried
306      * very quickly for information about the resource. If the actual resource
307      * handle is needed, it can be obtained from the proxy. Requesting the resource
308      * handle, or the full path of the resource, will degrade performance of the
309      * visit.
310      * <p>
311      * The entire subtree under the given resource is traversed to infinite depth,
312      * unless the visitor ignores a subtree by returning <code>false</code> from its
313      * <code>visit</code> method.
314      * </p>
315      * <p>No guarantees are made about the behavior of this method if resources
316      * are deleted or added during the traversal of this resource hierarchy. If
317      * resources are deleted during the traversal, they may still be passed to the
318      * visitor; if resources are created, they may not be passed to the visitor. If
319      * resources other than the one being visited are modified during the traversal,
320      * the resource proxy may contain stale information when that resource is
321      * visited.
322      * </p>
323      <p>
324      * If the <code>INCLUDE_PHANTOMS</code> flag is not specified in the member
325      * flags (recommended), only member resources that exist will be visited.
326      * If the <code>INCLUDE_PHANTOMS</code> flag is specified, the visit will
327      * also include any phantom member resource that the workspace is keeping track of.
328      * </p>
329      * <p>
330      * If the <code>INCLUDE_TEAM_PRIVATE_MEMBERS</code> flag is not specified
331      * (recommended), team private members will not be visited. If the
332      * <code>INCLUDE_TEAM_PRIVATE_MEMBERS</code> flag is specified in the member
333      * flags, team private member resources are visited as well.
334      * </p>
335      *
336      * @param visitor the visitor
337      * @param memberFlags bit-wise or of member flag constants
338      * (<code>IContainer.INCLUDE_PHANTOMS</code> and <code>INCLUDE_TEAM_PRIVATE_MEMBERS</code>)
339      * indicating which members are of interest
340      * @exception CoreException if this request fails. Reasons include:
341      * <ul>
342      * <li> the <code>INCLUDE_PHANTOMS</code> flag is not specified and
343      * this resource does not exist.</li>
344      * <li> the <code>INCLUDE_PHANTOMS</code> flag is not specified and
345      * this resource is a project that is not open.</li>
346      * <li> The visitor failed with this exception.</li>
347      * </ul>
348      * @see IContainer#INCLUDE_PHANTOMS
349      * @see IContainer#INCLUDE_TEAM_PRIVATE_MEMBERS
350      * @see IResource#isPhantom()
351      * @see IResource#isTeamPrivateMember()
352      * @see IResourceProxyVisitor#visit(IResourceProxy)
353      * @since 2.1
354      */

355     public void accept(final IResourceProxyVisitor visitor, int memberFlags) throws CoreException;
356
357     /**
358      * Accepts the given visitor.
359      * The visitor's <code>visit</code> method is called with this
360      * resource. If the visitor returns <code>true</code>, this method
361      * visits this resource's members.
362      * <p>
363      * This is a convenience method, fully equivalent to
364      * <code>accept(visitor,IResource.DEPTH_INFINITE, IResource.NONE)</code>.
365      * </p>
366      *
367      * @param visitor the visitor
368      * @exception CoreException if this method fails. Reasons include:
369      * <ul>
370      * <li> This resource does not exist.</li>
371      * <li> The visitor failed with this exception.</li>
372      * </ul>
373      * @see IResourceVisitor#visit(IResource)
374      * @see #accept(IResourceVisitor,int,int)
375      */

376     public void accept(IResourceVisitor visitor) throws CoreException;
377
378     /**
379      * Accepts the given visitor.
380      * The visitor's <code>visit</code> method is called with this
381      * resource. If the visitor returns <code>false</code>,
382      * this resource's members are not visited.
383      * <p>
384      * The subtree under the given resource is traversed to the supplied depth.
385      * </p>
386      * <p>
387      * This is a convenience method, fully equivalent to:
388      * <pre>
389      * accept(visitor, depth, includePhantoms ? INCLUDE_PHANTOMS : IResource.NONE);
390      * </pre>
391      * </p>
392      *
393      * @param visitor the visitor
394      * @param depth the depth to which members of this resource should be
395      * visited. One of <code>DEPTH_ZERO</code>, <code>DEPTH_ONE</code>,
396      * or <code>DEPTH_INFINITE</code>.
397      * @param includePhantoms <code>true</code> if phantom resources are
398      * of interest; <code>false</code> if phantom resources are not of
399      * interest.
400      * @exception CoreException if this request fails. Reasons include:
401      * <ul>
402      * <li> <code>includePhantoms</code> is <code>false</code> and
403      * this resource does not exist.</li>
404      * <li> <code>includePhantoms</code> is <code>true</code> and
405      * this resource does not exist and is not a phantom.</li>
406      * <li> The visitor failed with this exception.</li>
407      * </ul>
408      * @see IResource#isPhantom()
409      * @see IResourceVisitor#visit(IResource)
410      * @see IResource#DEPTH_ZERO
411      * @see IResource#DEPTH_ONE
412      * @see IResource#DEPTH_INFINITE
413      * @see IResource#accept(IResourceVisitor,int,int)
414      */

415     public void accept(IResourceVisitor visitor, int depth, boolean includePhantoms) throws CoreException;
416
417     /**
418      * Accepts the given visitor.
419      * The visitor's <code>visit</code> method is called with this
420      * resource. If the visitor returns <code>false</code>,
421      * this resource's members are not visited.
422      * <p>
423      * The subtree under the given resource is traversed to the supplied depth.
424      * </p>
425      * <p>
426      * No guarantees are made about the behavior of this method if resources are
427      * deleted or added during the traversal of this resource hierarchy. If
428      * resources are deleted during the traversal, they may still be passed to the
429      * visitor; if resources are created, they may not be passed to the visitor.
430      * </p>
431      * <p>
432      * If the <code>INCLUDE_PHANTOMS</code> flag is not specified in the member
433      * flags (recommended), only member resources that exists are visited.
434      * If the <code>INCLUDE_PHANTOMS</code> flag is specified, the visit also
435      * includes any phantom member resource that the workspace is keeping track of.
436      * </p>
437      * <p>
438      * If the <code>INCLUDE_TEAM_PRIVATE_MEMBERS</code> flag is not specified
439      * (recommended), team private members are not visited. If the
440      * <code>INCLUDE_TEAM_PRIVATE_MEMBERS</code> flag is specified in the member
441      * flags, team private member resources are visited as well.
442      * </p>
443      * <p>
444      * If the <code>EXCLUDE_DERIVED</code> flag is not specified
445      * (recommended), derived resources are visited. If the
446      * <code>EXCLUDE_DERIVED</code> flag is specified in the member
447      * flags, derived resources are not visited.
448      * </p>
449      *
450      * @param visitor the visitor
451      * @param depth the depth to which members of this resource should be
452      * visited. One of <code>DEPTH_ZERO</code>, <code>DEPTH_ONE</code>,
453      * or <code>DEPTH_INFINITE</code>.
454      * @param memberFlags bit-wise or of member flag constants
455      * (<code>INCLUDE_PHANTOMS</code>, <code>INCLUDE_TEAM_PRIVATE_MEMBERS</code>
456      * and <code>EXCLUDE_DERIVED</code>) indicating which members are of interest
457      * @exception CoreException if this request fails. Reasons include:
458      * <ul>
459      * <li> the <code>INCLUDE_PHANTOMS</code> flag is not specified and
460      * this resource does not exist.</li>
461      * <li> the <code>INCLUDE_PHANTOMS</code> flag is not specified and
462      * this resource is a project that is not open.</li>
463      * <li> The visitor failed with this exception.</li>
464      * </ul>
465      * @see IContainer#INCLUDE_PHANTOMS
466      * @see IContainer#INCLUDE_TEAM_PRIVATE_MEMBERS
467      * @see IContainer#EXCLUDE_DERIVED
468      * @see IResource#isDerived()
469      * @see IResource#isPhantom()
470      * @see IResource#isTeamPrivateMember()
471      * @see IResource#DEPTH_ZERO
472      * @see IResource#DEPTH_ONE
473      * @see IResource#DEPTH_INFINITE
474      * @see IResourceVisitor#visit(IResource)
475      * @since 2.0
476      */

477     public void accept(IResourceVisitor visitor, int depth, int memberFlags) throws CoreException;
478
479     /**
480      * Removes the local history of this resource and its descendents.
481      * <p>
482      * This operation is long-running; progress and cancellation are provided
483      * by the given progress monitor.
484      * </p>
485      * @param monitor a progress monitor, or <code>null</code> if progress
486      * reporting and cancellation are not desired
487      */

488     public void clearHistory(IProgressMonitor monitor) throws CoreException;
489
490     /**
491      * Makes a copy of this resource at the given path.
492      * <p>
493      * This is a convenience method, fully equivalent to:
494      * <pre>
495      * copy(destination, (force ? FORCE : IResource.NONE), monitor);
496      * </pre>
497      * </p>
498      * <p>
499      * This operation changes resources; these changes will be reported
500      * in a subsequent resource change event that will include
501      * an indication that the resource copy has been added to its new parent.
502      * </p>
503      * <p>
504      * This operation is long-running; progress and cancellation are provided
505      * by the given progress monitor.
506      * </p>
507      *
508      * @param destination the destination path
509      * @param force a flag controlling whether resources that are not
510      * in sync with the local file system will be tolerated
511      * @param monitor a progress monitor, or <code>null</code> if progress
512      * reporting is not desired
513      * @exception CoreException if this resource could not be copied. Reasons include:
514      * <ul>
515      * <li> This resource does not exist.</li>
516      * <li> This resource or one of its descendents is not local.</li>
517      * <li> The source or destination is the workspace root.</li>
518      * <li> The source is a project but the destination is not.</li>
519      * <li> The destination is a project but the source is not.</li>
520      * <li> The resource corresponding to the parent destination path does not exist.</li>
521      * <li> The resource corresponding to the parent destination path is a closed project.</li>
522      * <li> A resource at destination path does exist.</li>
523      * <li> This resource or one of its descendents is out of sync with the local file
524      * system and <code>force</code> is <code>false</code>.</li>
525      * <li> The workspace and the local file system are out of sync
526      * at the destination resource or one of its descendents.</li>
527      * <li> The source resource is a file and the destination path specifies a project.</li>
528      * <li> Resource changes are disallowed during certain types of resource change
529      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
530      * </ul>
531      * @exception OperationCanceledException if the operation is canceled.
532      * Cancelation can occur even if no progress monitor is provided.
533      */

534     public void copy(IPath destination, boolean force, IProgressMonitor monitor) throws CoreException;
535
536     /**
537      * Makes a copy of this resource at the given path. The resource's
538      * descendents are copied as well. The path of this resource must not be a
539      * prefix of the destination path. The workspace root may not be the source or
540      * destination location of a copy operation, and a project can only be copied to
541      * another project. After successful completion, corresponding new resources
542      * will exist at the given path; their contents and properties will be copies of
543      * the originals. The original resources are not affected.
544      * <p>
545      * The supplied path may be absolute or relative. Absolute paths fully specify
546      * the new location for the resource, including its project. Relative paths are
547      * considered to be relative to the container of the resource being copied. A
548      * trailing separator is ignored.
549      * </p>
550      * <p>
551      * Calling this method with a one segment absolute destination path is
552      * equivalent to calling:
553      * <pre>
554      * copy(workspace.newProjectDescription(folder.getName()),updateFlags,monitor);
555      * </pre>
556      * </p>
557      * <p> When a resource is copied, its persistent properties are copied with it.
558      * Session properties and markers are not copied.
559      * </p>
560      * <p>
561      * The <code>FORCE</code> update flag controls how this method deals with cases
562      * where the workspace is not completely in sync with the local file system. If
563      * <code>FORCE</code> is not specified, the method will only attempt to copy
564      * resources that are in sync with the corresponding files and directories in
565      * the local file system; it will fail if it encounters a resource that is out
566      * of sync with the file system. However, if <code>FORCE</code> is specified,
567      * the method copies all corresponding files and directories from the local file
568      * system, including ones that have been recently updated or created. Note that
569      * in both settings of the <code>FORCE</code> flag, the operation fails if the
570      * newly created resources in the workspace would be out of sync with the local
571      * file system; this ensures files in the file system cannot be accidentally
572      * overwritten.
573      * </p>
574      * <p>
575      * The <code>SHALLOW</code> update flag controls how this method deals with linked
576      * resources. If <code>SHALLOW</code> is not specified, then the underlying
577      * contents of the linked resource will always be copied in the file system. In
578      * this case, the destination of the copy will never be a linked resource or
579      * contain any linked resources. If <code>SHALLOW</code> is specified when a
580      * linked resource is copied into another project, a new linked resource is
581      * created in the destination project that points to the same file system
582      * location. When a project containing linked resources is copied, the new
583      * project will contain the same linked resources pointing to the same file
584      * system locations. For both of these shallow cases, no files on disk under
585      * the linked resource are actually copied. With the <code>SHALLOW</code> flag,
586      * copying of linked resources into anything other than a project is not
587      * permitted. The <code>SHALLOW</code> update flag is ignored when copying non-
588      * linked resources.
589      * </p>
590      * <p>
591      * The {@link #DERIVED} update flag indicates that the new resource
592      * should immediately be set as a derived resource. Specifying this flag
593      * is equivalent to atomically calling {@link #setDerived(boolean)}
594      * with a value of <code>true</code> immediately after creating the resource.
595      * </p>
596      * <p>
597      * The {@link #TEAM_PRIVATE} update flag indicates that the new resource
598      * should immediately be set as a team private resource. Specifying this flag
599      * is equivalent to atomically calling {@link #setTeamPrivateMember(boolean)}
600      * with a value of <code>true</code> immediately after creating the resource.
601      * </p>
602      * <p>
603      * Update flags other than those listed above are ignored.
604      * </p>
605      * <p>
606      * This operation changes resources; these changes will be reported in a
607      * subsequent resource change event that will include an indication that the
608      * resource copy has been added to its new parent.
609      * </p>
610      * <p>
611      * An attempt will be made to copy the local history for this resource and its children,
612      * to the destination. Since local history existence is a safety-net mechanism, failure
613      * of this action will not result in automatic failure of the copy operation.
614      * </p>
615      * <p>
616      * This operation is long-running; progress and cancellation are provided
617      * by the given progress monitor.
618      * </p>
619      *
620      * @param destination the destination path
621      * @param updateFlags bit-wise or of update flag constants
622      * ({@link #FORCE}, {@link #SHALLOW}, {@link #DERIVED}, {@link #TEAM_PRIVATE})
623      * @param monitor a progress monitor, or <code>null</code> if progress
624      * reporting is not desired
625      * @exception CoreException if this resource could not be copied. Reasons include:
626      * <ul>
627      * <li> This resource does not exist.</li>
628      * <li> This resource or one of its descendents is not local.</li>
629      * <li> The source or destination is the workspace root.</li>
630      * <li> The source is a project but the destination is not.</li>
631      * <li> The destination is a project but the source is not.</li>
632      * <li> The resource corresponding to the parent destination path does not exist.</li>
633      * <li> The resource corresponding to the parent destination path is a closed project.</li>
634      * <li> The source is a linked resource, but the destination is not a project,
635      * and <code>SHALLOW</code> is specified.</li>
636      * <li> A resource at destination path does exist.</li>
637      * <li> This resource or one of its descendents is out of sync with the local file
638      * system and <code>FORCE</code> is not specified.</li>
639      * <li> The workspace and the local file system are out of sync
640      * at the destination resource or one of its descendents.</li>
641      * <li> The source resource is a file and the destination path specifies a project.</li>
642      * <li> The source is a linked resource, and the destination path does not
643      * specify a project.</li>
644      * <li> The location of the source resource on disk is the same or a prefix of
645      * the location of the destination resource on disk.</li>
646      * <li> Resource changes are disallowed during certain types of resource change
647      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
648      * </ul>
649      * @exception OperationCanceledException if the operation is canceled.
650      * Cancelation can occur even if no progress monitor is provided.
651      * @see #FORCE
652      * @see #SHALLOW
653      * @see #DERIVED
654      * @see #TEAM_PRIVATE
655      * @see IResourceRuleFactory#copyRule(IResource, IResource)
656      * @since 2.0
657      */

658     public void copy(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException;
659
660     /**
661      * Makes a copy of this project using the given project description.
662      * <p>
663      * This is a convenience method, fully equivalent to:
664      * <pre>
665      * copy(description, (force ? FORCE : IResource.NONE), monitor);
666      * </pre>
667      * </p>
668      * <p>
669      * This operation changes resources; these changes will be reported
670      * in a subsequent resource change event that will include
671      * an indication that the resource copy has been added to its new parent.
672      * </p>
673      * <p>
674      * This operation is long-running; progress and cancellation are provided
675      * by the given progress monitor.
676      * </p>
677      *
678      * @param description the destination project description
679      * @param force a flag controlling whether resources that are not
680      * in sync with the local file system will be tolerated
681      * @param monitor a progress monitor, or <code>null</code> if progress
682      * reporting is not desired
683      * @exception CoreException if this resource could not be copied. Reasons include:
684      * <ul>
685      * <li> This resource does not exist.</li>
686      * <li> This resource or one of its descendents is not local.</li>
687      * <li> This resource is not a project.</li>
688      * <li> The project described by the given description already exists.</li>
689      * <li> This resource or one of its descendents is out of sync with the local file
690      * system and <code>force</code> is <code>false</code>.</li>
691      * <li> The workspace and the local file system are out of sync
692      * at the destination resource or one of its descendents.</li>
693      * <li> Resource changes are disallowed during certain types of resource change
694      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
695      * </ul>
696      * @exception OperationCanceledException if the operation is canceled.
697      * Cancelation can occur even if no progress monitor is provided.
698      */

699     public void copy(IProjectDescription description, boolean force, IProgressMonitor monitor) throws CoreException;
700
701     /**
702      * Makes a copy of this project using the given project description.
703      * The project's descendents are copied as well. The description specifies the
704      * name, location and attributes of the new project. After successful
705      * completion, corresponding new resources will exist at the given path; their
706      * contents and properties will be copies of the originals. The original
707      * resources are not affected.
708      * <p>
709      * When a resource is copied, its persistent properties are copied with it.
710      * Session properties and markers are not copied.
711      * </p>
712      * <p> The <code>FORCE</code> update flag controls how this method deals with
713      * cases where the workspace is not completely in sync with the local file
714      * system. If <code>FORCE</code> is not specified, the method will only attempt
715      * to copy resources that are in sync with the corresponding files and
716      * directories in the local file system; it will fail if it encounters a
717      * resource that is out of sync with the file system. However, if
718      * <code>FORCE</code> is specified, the method copies all corresponding files
719      * and directories from the local file system, including ones that have been
720      * recently updated or created. Note that in both settings of the
721      * <code>FORCE</code> flag, the operation fails if the newly created resources
722      * in the workspace would be out of sync with the local file system; this
723      * ensures files in the file system cannot be accidentally overwritten.
724      * </p>
725      * <p>
726      * The <code>SHALLOW</code> update flag controls how this method deals with
727      * linked resources. If <code>SHALLOW</code> is not specified, then the
728      * underlying contents of any linked resources in the project will always be
729      * copied in the file system. In this case, the destination of the copy will
730      * never contain any linked resources. If <code>SHALLOW</code> is specified
731      * when a project containing linked resources is copied, new linked resources
732      * are created in the destination project that point to the same file system
733      * locations. In this case, no files on disk under linked resources are
734      * actually copied. The <code>SHALLOW</code> update flag is ignored when copying
735      * non- linked resources.
736      * </p>
737      * <p>
738      * Update flags other than <code>FORCE</code> or <code>SHALLOW</code> are ignored.
739      * </p>
740      * <p>
741      * An attempt will be made to copy the local history for this resource and its children,
742      * to the destination. Since local history existence is a safety-net mechanism, failure
743      * of this action will not result in automatic failure of the copy operation.
744      * </p>
745      * <p> This operation changes resources; these changes will be reported in a
746      * subsequent resource change event that will include an indication that the
747      * resource copy has been added to its new parent.
748      * </p>
749      * <p>
750      * This operation is long-running; progress and cancellation are provided
751      * by the given progress monitor.
752      * </p>
753      *
754      * @param description the destination project description
755      * @param updateFlags bit-wise or of update flag constants
756      * (<code>FORCE</code> and <code>SHALLOW</code>)
757      * @param monitor a progress monitor, or <code>null</code> if progress
758      * reporting is not desired
759      * @exception CoreException if this resource could not be copied. Reasons include:
760      * <ul>
761      * <li> This resource does not exist.</li>
762      * <li> This resource or one of its descendents is not local.</li>
763      * <li> This resource is not a project.</li>
764      * <li> The project described by the given description already exists.</li>
765      * <li> This resource or one of its descendents is out of sync with the local file
766      * system and <code>FORCE</code> is not specified.</li>
767      * <li> The workspace and the local file system are out of sync
768      * at the destination resource or one of its descendents.</li>
769      * <li> Resource changes are disallowed during certain types of resource change
770      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
771      * </ul>
772      * @exception OperationCanceledException if the operation is canceled.
773      * Cancelation can occur even if no progress monitor is provided.
774      * @see #FORCE
775      * @see #SHALLOW
776      * @see IResourceRuleFactory#copyRule(IResource, IResource)
777      * @since 2.0
778      */

779     public void copy(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException;
780
781     /**
782      * Creates and returns the marker with the specified type on this resource.
783      * Marker type ids are the id of an extension installed in the
784      * <code>org.eclipse.core.resources.markers</code> extension
785      * point. The specified type string must not be <code>null</code>.
786      *
787      * @param type the type of the marker to create
788      * @return the handle of the new marker
789      * @exception CoreException if this method fails. Reasons include:
790      * <ul>
791      * <li> This resource does not exist.</li>
792      * <li> This resource is a project that is not open.</li>
793      * </ul>
794      * @see IResourceRuleFactory#markerRule(IResource)
795      */

796     public IMarker createMarker(String JavaDoc type) throws CoreException;
797
798     /**
799      * Creates a resource proxy representing the current state of this resource.
800      * <p>
801      * Note that once a proxy has been created, it does not stay in sync
802      * with the corresponding resource. Changes to the resource after
803      * the proxy is created will not be reflected in the state of the proxy.
804      * </p>
805      *
806      * @return A proxy representing this resource
807      * @since 3.2
808      */

809     public IResourceProxy createProxy();
810
811     /**
812      * Deletes this resource from the workspace.
813      * <p>
814      * This is a convenience method, fully equivalent to:
815      * <pre>
816      * delete(force ? FORCE : IResource.NONE, monitor);
817      * </pre>
818      * </p>
819      * <p>
820      * This method changes resources; these changes will be reported
821      * in a subsequent resource change event.
822      * </p>
823      * <p>
824      * This method is long-running; progress and cancellation are provided
825      * by the given progress monitor.
826      * </p>
827      *
828      * @param force a flag controlling whether resources that are not
829      * in sync with the local file system will be tolerated
830      * @param monitor a progress monitor, or <code>null</code> if progress
831      * reporting is not desired
832      * @exception CoreException if this method fails. Reasons include:
833      * <ul>
834      * <li> This resource could not be deleted for some reason.</li>
835      * <li> This resource or one of its descendents is out of sync with the local file system
836      * and <code>force</code> is <code>false</code>.</li>
837      * <li> Resource changes are disallowed during certain types of resource change
838      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
839      * </ul>
840      * @exception OperationCanceledException if the operation is canceled.
841      * Cancelation can occur even if no progress monitor is provided.
842      *
843      * @see IResource#delete(int,IProgressMonitor)
844      */

845     public void delete(boolean force, IProgressMonitor monitor) throws CoreException;
846
847     /**
848      * Deletes this resource from the workspace.
849      * Deletion applies recursively to all members of this resource in a "best-
850      * effort" fashion. That is, all resources which can be deleted are deleted.
851      * Resources which could not be deleted are noted in a thrown exception. The
852      * method does not fail if resources do not exist; it fails only if resources
853      * could not be deleted.
854      * <p>
855      * Deleting a non-linked resource also deletes its contents from the local file
856      * system. In the case of a file or folder resource, the corresponding file or
857      * directory in the local file system is deleted. Deleting an open project
858      * recursively deletes its members; deleting a closed project just gets rid of
859      * the project itself (closed projects have no members); files in the project's
860      * local content area are retained; referenced projects are unaffected.
861      * </p>
862      * <p>
863      * Deleting a linked resource does not delete its contents from the file system,
864      * it just removes that resource and its children from the workspace. Deleting
865      * children of linked resources does remove the contents from the file system.
866      * </p>
867      * <p>
868      * Deleting a resource also deletes its session and persistent properties and
869      * markers.
870      * </p>
871      * <p>
872      * Deleting a non-project resource which has sync information converts the
873      * resource to a phantom and retains the sync information for future use.
874      * </p>
875      * <p>
876      * Deleting the workspace root resource recursively deletes all projects,
877      * and removes all markers, properties, sync info and other data related to the
878      * workspace root; the root resource itself is not deleted, however.
879      * </p>
880      * <p>
881      * This method changes resources; these changes will be reported
882      * in a subsequent resource change event.
883      * </p>
884      * <p>
885      * This method is long-running; progress and cancellation are provided
886      * by the given progress monitor.
887      * </p>
888      * <p>
889      * The <code>FORCE</code> update flag controls how this method deals with
890      * cases where the workspace is not completely in sync with the local
891      * file system. If <code>FORCE</code> is not specified, the method will only
892      * attempt to delete files and directories in the local file system that
893      * correspond to, and are in sync with, resources in the workspace; it will fail
894      * if it encounters a file or directory in the file system that is out of sync
895      * with the workspace. This option ensures there is no unintended data loss;
896      * it is the recommended setting. However, if <code>FORCE</code> is specified,
897      * the method will ruthlessly attempt to delete corresponding files and
898      * directories in the local file system, including ones that have been recently
899      * updated or created.
900      * </p>
901      * <p>
902      * The <code>KEEP_HISTORY</code> update flag controls whether or not files that
903      * are about to be deleted from the local file system have their current
904      * contents saved in the workspace's local history. The local history mechanism
905      * serves as a safety net to help the user recover from mistakes that might
906      * otherwise result in data loss. Specifying <code>KEEP_HISTORY</code> is
907      * recommended except in circumstances where past states of the files are of no
908      * conceivable interest to the user. Note that local history is maintained
909      * with each individual project, and gets discarded when a project is deleted
910      * from the workspace. Hence <code>KEEP_HISTORY</code> is only really applicable
911      * when deleting files and folders, but not projects.
912      * </p>
913      * <p>
914      * The <code>ALWAYS_DELETE_PROJECT_CONTENTS</code> update flag controls how
915      * project deletions are handled. If <code>ALWAYS_DELETE_PROJECT_CONTENTS</code>
916      * is specified, then the files and folders in a project's local content area
917      * are deleted, regardless of whether the project is open or closed;
918      * <code>FORCE</code> is assumed regardless of whether it is specified. If
919      * <code>NEVER_DELETE_PROJECT_CONTENTS</code> is specified, then the files and
920      * folders in a project's local content area are retained, regardless of whether
921      * the project is open or closed; the <code>FORCE</code> flag is ignored. If
922      * neither of these flags is specified, files and folders in a project's local
923      * content area from open projects (subject to the <code>FORCE</code> flag), but
924      * never from closed projects.
925      * </p>
926      *
927      * @param updateFlags bit-wise or of update flag constants (
928      * <code>FORCE</code>, <code>KEEP_HISTORY</code>,
929      * <code>ALWAYS_DELETE_PROJECT_CONTENTS</code>,
930      * and <code>NEVER_DELETE_PROJECT_CONTENTS</code>)
931      * @param monitor a progress monitor, or <code>null</code> if progress
932      * reporting is not desired
933      * @exception CoreException if this method fails. Reasons include:
934      * <ul>
935      * <li> This resource could not be deleted for some reason.</li>
936      * <li> This resource or one of its descendents is out of sync with the local file system
937      * and <code>FORCE</code> is not specified.</li>
938      * <li> Resource changes are disallowed during certain types of resource change
939      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
940      * </ul>
941      * @exception OperationCanceledException if the operation is canceled.
942      * Cancelation can occur even if no progress monitor is provided.
943      * @see IFile#delete(boolean, boolean, IProgressMonitor)
944      * @see IFolder#delete(boolean, boolean, IProgressMonitor)
945      * @see #FORCE
946      * @see #KEEP_HISTORY
947      * @see #ALWAYS_DELETE_PROJECT_CONTENT
948      * @see #NEVER_DELETE_PROJECT_CONTENT
949      * @see IResourceRuleFactory#deleteRule(IResource)
950      * @since 2.0
951      */

952     public void delete(int updateFlags, IProgressMonitor monitor) throws CoreException;
953
954     /**
955      * Deletes all markers on this resource of the given type, and,
956      * optionally, deletes such markers from its children. If <code>includeSubtypes</code>
957      * is <code>false</code>, only markers whose type exactly matches
958      * the given type are deleted.
959      * <p>
960      * This method changes resources; these changes will be reported
961      * in a subsequent resource change event.
962      * </p>
963      *
964      * @param type the type of marker to consider, or <code>null</code> to indicate all types
965      * @param includeSubtypes whether or not to consider sub-types of the given type
966      * @param depth how far to recurse (see <code>IResource.DEPTH_* </code>)
967      * @exception CoreException if this method fails. Reasons include:
968      * <ul>
969      * <li> This resource does not exist.</li>
970      * <li> This resource is a project that is not open.</li>
971      * <li> Resource changes are disallowed during certain types of resource change
972      * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
973      * </ul>
974      * @see IResource#DEPTH_ZERO
975      * @see IResource#DEPTH_ONE
976      * @see IResource#DEPTH_INFINITE
977      * @see IResourceRuleFactory#markerRule(IResource)
978      */

979     public void deleteMarkers(String JavaDoc type, boolean includeSubtypes, int depth) throws CoreException;
980
981     /**
982      * Compares two objects for equality;
983      * for resources, equality is defined in terms of their handles:
984      * same resource type, equal full paths, and identical workspaces.
985      * Resources are not equal to objects other than resources.
986      *
987      * @param other the other object
988      * @return an indication of whether the objects are equals
989      * @see #getType()
990      * @see #getFullPath()
991      * @see #getWorkspace()
992      */

993     public boolean equals(Object JavaDoc other);
994
995     /**
996      * Returns whether this resource exists in the workspace.
997      * <p>
998      * <code>IResource</code> objects are lightweight handle objects
999      * used to access resources in the workspace. However, having a
1000     * handle object does not necessarily mean the workspace really
1001     * has such a resource. When the workspace does have a genuine
1002     * resource of a matching type, the resource is said to
1003     * <em>exist</em>, and this method returns <code>true</code>;
1004     * in all other cases, this method returns <code>false</code>.
1005     * In particular, it returns <code>false</code> if the workspace
1006     * has no resource at that path, or if it has a resource at that
1007     * path with a type different from the type of this resource handle.
1008     * </p>
1009     * <p>
1010     * Note that no resources ever exist under a project
1011     * that is closed; opening a project may bring some
1012     * resources into existence.
1013     * </p>
1014     * <p>
1015     * The name and path of a resource handle may be invalid.
1016     * However, validation checks are done automatically as a
1017     * resource is created; this means that any resource that exists
1018     * can be safely assumed to have a valid name and path.
1019     * </p>
1020     *
1021     * @return <code>true</code> if the resource exists, otherwise
1022     * <code>false</code>
1023     */

1024    public boolean exists();
1025
1026    /**
1027     * Returns the marker with the specified id on this resource,
1028     * Returns <code>null</code> if there is no matching marker.
1029     *
1030     * @param id the id of the marker to find
1031     * @return a marker or <code>null</code>
1032     * @exception CoreException if this method fails. Reasons include:
1033     * <ul>
1034     * <li> This resource does not exist.</li>
1035     * <li> This resource is a project that is not open.</li>
1036     * </ul>
1037     */

1038    public IMarker findMarker(long id) throws CoreException;
1039
1040    /**
1041     * Returns all markers of the specified type on this resource,
1042     * and, optionally, on its children. If <code>includeSubtypes</code>
1043     * is <code>false</code>, only markers whose type exactly matches
1044     * the given type are returned. Returns an empty array if there
1045     * are no matching markers.
1046     *
1047     * @param type the type of marker to consider, or <code>null</code> to indicate all types
1048     * @param includeSubtypes whether or not to consider sub-types of the given type
1049     * @param depth how far to recurse (see <code>IResource.DEPTH_* </code>)
1050     * @return an array of markers
1051     * @exception CoreException if this method fails. Reasons include:
1052     * <ul>
1053     * <li> This resource does not exist.</li>
1054     * <li> This resource is a project that is not open.</li>
1055     * </ul>
1056     * @see IResource#DEPTH_ZERO
1057     * @see IResource#DEPTH_ONE
1058     * @see IResource#DEPTH_INFINITE
1059     */

1060    public IMarker[] findMarkers(String JavaDoc type, boolean includeSubtypes, int depth) throws CoreException;
1061
1062    /**
1063     * Returns the maximum value of the {@link IMarker#SEVERITY} attribute across markers
1064     * of the specified type on this resource, and, optionally, on its children.
1065     * If <code>includeSubtypes</code>is <code>false</code>, only markers whose type
1066     * exactly matches the given type are considered.
1067     * Returns <code>-1</code> if there are no matching markers.
1068     * Returns {@link IMarker#SEVERITY_ERROR} if any of the markers has a severity
1069     * greater than or equal to {@link IMarker#SEVERITY_ERROR}.
1070     *
1071     * @param type the type of marker to consider (normally {@link IMarker#PROBLEM}
1072     * or one of its subtypes), or <code>null</code> to indicate all types
1073     *
1074     * @param includeSubtypes whether or not to consider sub-types of the given type
1075     * @param depth how far to recurse (see <code>IResource.DEPTH_* </code>)
1076     * @return {@link IMarker#SEVERITY_INFO}, {@link IMarker#SEVERITY_WARNING}, {@link IMarker#SEVERITY_ERROR}, or -1
1077     * @exception CoreException if this method fails. Reasons include:
1078     * <ul>
1079     * <li> This resource does not exist.</li>
1080     * <li> This resource is a project that is not open.</li>
1081     * </ul>
1082     * @see IResource#DEPTH_ZERO
1083     * @see IResource#DEPTH_ONE
1084     * @see IResource#DEPTH_INFINITE
1085     * @since 3.3
1086     */

1087    public int findMaxProblemSeverity(String JavaDoc type, boolean includeSubtypes, int depth) throws CoreException;
1088
1089    /**
1090     * Returns the file extension portion of this resource's name,
1091     * or <code>null</code> if it does not have one.
1092     * <p>
1093     * The file extension portion is defined as the string
1094     * following the last period (".") character in the name.
1095     * If there is no period in the name, the path has no
1096     * file extension portion. If the name ends in a period,
1097     * the file extension portion is the empty string.
1098     * </p>
1099     * <p>
1100     * This is a resource handle operation; the resource need
1101     * not exist.
1102     * </p>
1103     *
1104     * @return a string file extension
1105     * @see #getName()
1106     */

1107    public String JavaDoc getFileExtension();
1108
1109    /**
1110     * Returns the full, absolute path of this resource relative to the
1111     * workspace.
1112     * <p>
1113     * This is a resource handle operation; the resource need
1114     * not exist.
1115     * If this resource does exist, its path can be safely assumed to be valid.
1116     * </p>
1117     * <p>
1118     * A resource's full path indicates the route from the root of the workspace
1119     * to the resource. Within a workspace, there is exactly one such path
1120     * for any given resource. The first segment of these paths name a project;
1121     * remaining segments, folders and/or files within that project.
1122     * The returned path never has a trailing separator. The path of the
1123     * workspace root is <code>Path.ROOT</code>.
1124     * </p>
1125     * <p>
1126     * Since absolute paths contain the name of the project, they are
1127     * vulnerable when the project is renamed. For most situations,
1128     * project-relative paths are recommended over absolute paths.
1129     * </p>
1130     *
1131     * @return the absolute path of this resource
1132     * @see #getProjectRelativePath()
1133     * @see Path#ROOT
1134     */

1135    public IPath getFullPath();
1136
1137    /**
1138     * Returns a cached value of the local time stamp on disk for this resource, or
1139     * <code>NULL_STAMP</code> if the resource does not exist or is not local or is
1140     * not accessible. The return value is represented as the number of milliseconds
1141     * since the epoch (00:00:00 GMT, January 1, 1970).
1142     * The returned value may not be the same as the actual time stamp
1143     * on disk if the file has been modified externally since the last local refresh.
1144     * <p>
1145     * Note that due to varying file system timing granularities, this value is not guaranteed
1146     * to change every time the file is modified. For a more reliable indication of whether
1147     * the file has changed, use <code>getModificationStamp</code>.
1148     *
1149     * @return a local file system time stamp, or <code>NULL_STAMP</code>.
1150     * @since 3.0
1151     */

1152    public long getLocalTimeStamp();
1153
1154    /**
1155     * Returns the absolute path in the local file system to this resource,
1156     * or <code>null</code> if no path can be determined.
1157     * <p>
1158     * If this resource is the workspace root, this method returns
1159     * the absolute local file system path of the platform working area.
1160     * </p><p>
1161     * If this resource is a project that exists in the workspace, this method
1162     * returns the path to the project's local content area. This is true regardless
1163     * of whether the project is open or closed. This value will be null in the case
1164     * where the location is relative to an undefined workspace path variable.
1165     * </p><p>
1166     * If this resource is a linked resource under a project that is open, this
1167     * method returns the resolved path to the linked resource's local contents.
1168     * This value will be null in the case where the location is relative to an
1169     * undefined workspace path variable.
1170     * </p><p>
1171     * If this resource is a file or folder under a project that exists, or a
1172     * linked resource under a closed project, this method returns a (non-
1173     * <code>null</code>) path computed from the location of the project's local
1174     * content area and the project- relative path of the file or folder. This is
1175     * true regardless of whether the file or folders exists, or whether the project
1176     * is open or closed. In the case of linked resources, the location of a linked resource
1177     * within a closed project is too computed from the location of the
1178     * project's local content area and the project-relative path of the resource. If the
1179     * linked resource resides in an open project then its location is computed
1180     * according to the link.
1181     * </p><p>
1182     * If this resource is a project that does not exist in the workspace,
1183     * or a file or folder below such a project, this method returns
1184     * <code>null</code>. This method also returns <code>null</code> if called
1185     * on a resource that is not stored in the local file system. For such resources
1186     * {@link #getLocationURI()} should be used instead.
1187     * </p>
1188     *
1189     * @return the absolute path of this resource in the local file system,
1190     * or <code>null</code> if no path can be determined
1191     * @see #getRawLocation()
1192     * @see #getLocationURI()
1193     * @see IProjectDescription#setLocation(IPath)
1194     * @see Platform#getLocation()
1195     */

1196    public IPath getLocation();
1197
1198    /**
1199     * Returns the absolute URI of this resource,
1200     * or <code>null</code> if no URI can be determined.
1201     * <p>
1202     * If this resource is the workspace root, this method returns
1203     * the absolute location of the platform working area.
1204     * </p><p>
1205     * If this resource is a project that exists in the workspace, this method
1206     * returns the URI to the project's local content area. This is true regardless
1207     * of whether the project is open or closed. This value will be null in the case
1208     * where the location is relative to an undefined workspace path variable.
1209     * </p><p>
1210     * If this resource is a linked resource under a project that is open, this
1211     * method returns the resolved URI to the linked resource's local contents.
1212     * This value will be null in the case where the location is relative to an
1213     * undefined workspace path variable.
1214     * </p><p>
1215     * If this resource is a file or folder under a project that exists, or a
1216     * linked resource under a closed project, this method returns a (non-
1217     * <code>null</code>) URI computed from the location of the project's local
1218     * content area and the project- relative path of the file or folder. This is
1219     * true regardless of whether the file or folders exists, or whether the project
1220     * is open or closed. In the case of linked resources, the location of a linked resource
1221     * within a closed project is computed from the location of the
1222     * project's local content area and the project-relative path of the resource. If the
1223     * linked resource resides in an open project then its location is computed
1224     * according to the link.
1225     * </p><p>
1226     * If this resource is a project that does not exist in the workspace,
1227     * or a file or folder below such a project, this method returns
1228     * <code>null</code>.
1229     * </p>
1230     *
1231     * @return the absolute URI of this resource,
1232     * or <code>null</code> if no URI can be determined
1233     * @see #getRawLocation()
1234     * @see IProjectDescription#setLocation(IPath)
1235     * @see Platform#getLocation()
1236     * @see java.net.URI
1237     * @since 3.2
1238     */

1239    public URI JavaDoc getLocationURI();
1240
1241    /**
1242     * Returns a marker handle with the given id on this resource.
1243     * This resource is not checked to see if it has such a marker.
1244     * The returned marker need not exist.
1245     * This resource need not exist.
1246     *
1247     * @param id the id of the marker
1248     * @return the specified marker handle
1249     * @see IMarker#getId()
1250     */

1251    public IMarker getMarker(long id);
1252
1253    /**
1254     * Returns a non-negative modification stamp, or <code>NULL_STAMP</code> if
1255     * the resource does not exist or is not local or is not accessible.
1256     * <p>
1257     * A resource's modification stamp gets updated each time a resource is modified.
1258     * If a resource's modification stamp is the same, the resource has not changed.
1259     * Conversely, if a resource's modification stamp is different, some aspect of it
1260     * (other than properties) has been modified at least once (possibly several times).
1261     * Resource modification stamps are preserved across project close/re-open,
1262     * and across workspace shutdown/restart.
1263     * The magnitude or sign of the numerical difference between two modification stamps
1264     * is not significant.
1265     * </p>
1266     * <p>
1267     * The following things affect a resource's modification stamp:
1268     * <ul>
1269     * <li>creating a non-project resource (changes from <code>NULL_STAMP</code>)</li>
1270     * <li>changing the contents of a file</li>
1271     * <li><code>touch</code>ing a resource</li>
1272     * <li>setting the attributes of a project presented in a project description</li>
1273     * <li>deleting a resource (changes to <code>NULL_STAMP</code>)</li>
1274     * <li>moving a resource (source changes to <code>NULL_STAMP</code>,
1275     destination changes from <code>NULL_STAMP</code>)</li>
1276     * <li>copying a resource (destination changes from <code>NULL_STAMP</code>)</li>
1277     * <li>making a resource local</li>
1278     * <li>closing a project (changes to <code>NULL_STAMP</code>)</li>
1279     * <li>opening a project (changes from <code>NULL_STAMP</code>)</li>
1280     * <li>adding or removing a project nature (changes from <code>NULL_STAMP</code>)</li>
1281     * </ul>
1282     * The following things do not affect a resource's modification stamp:
1283     * <ul>
1284     * <li>"reading" a resource</li>
1285     * <li>adding or removing a member of a project or folder</li>
1286     * <li>setting a session property</li>
1287     * <li>setting a persistent property</li>
1288     * <li>saving the workspace</li>
1289     * <li>shutting down and re-opening a workspace</li>
1290     * </ul>
1291     * </p>
1292     *
1293     * @return the modification stamp, or <code>NULL_STAMP</code> if this resource either does
1294     * not exist or exists as a closed project
1295     * @see IResource#NULL_STAMP
1296     * @see #revertModificationStamp(long)
1297     */

1298    public long getModificationStamp();
1299
1300    /**
1301     * Returns the name of this resource.
1302     * The name of a resource is synonymous with the last segment
1303     * of its full (or project-relative) path for all resources other than the
1304     * workspace root. The workspace root's name is the empty string.
1305     * <p>
1306     * This is a resource handle operation; the resource need
1307     * not exist.
1308     * </p>
1309     * <p>
1310     * If this resource exists, its name can be safely assumed to be valid.
1311     * </p>
1312     *
1313     * @return the name of the resource
1314     * @see #getFullPath()
1315     * @see #getProjectRelativePath()
1316     */

1317    public String JavaDoc getName();
1318
1319    /**
1320     * Returns the resource which is the parent of this resource,
1321     * or <code>null</code> if it has no parent (that is, this
1322     * resource is the workspace root).
1323     * <p>
1324     * The full path of the parent resource is the same as this
1325     * resource's full path with the last segment removed.
1326     * </p>
1327     * <p>
1328     * This is a resource handle operation; neither the resource
1329     * nor the resulting resource need exist.
1330     * </p>
1331     *
1332     * @return the parent resource of this resource,
1333     * or <code>null</code> if it has no parent
1334     */

1335    public IContainer getParent();
1336
1337    /**
1338     * Returns the value of the persistent property of this resource identified
1339     * by the given key, or <code>null</code> if this resource has no such property.
1340     *
1341     * @param key the qualified name of the property
1342     * @return the string value of the property,
1343     * or <code>null</code> if this resource has no such property
1344     * @exception CoreException if this method fails. Reasons include:
1345     * <ul>
1346     * <li> This resource does not exist.</li>
1347     * <li> This resource is not local.</li>
1348     * <li> This resource is a project that is not open.</li>
1349     * </ul>
1350     * @see #setPersistentProperty(QualifiedName, String)
1351     */

1352    public String JavaDoc getPersistentProperty(QualifiedName key) throws CoreException;
1353
1354    /**
1355     * Returns the project which contains this resource.
1356     * Returns itself for projects and <code>null</code>
1357     * for the workspace root.
1358     * <p>
1359     * A resource's project is the one named by the first segment
1360     * of its full path.
1361     * </p>
1362     * <p>
1363     * This is a resource handle operation; neither the resource
1364     * nor the resulting project need exist.
1365     * </p>
1366     *
1367     * @return the project handle
1368     */

1369    public IProject getProject();
1370
1371    /**
1372     * Returns a relative path of this resource with respect to its project.
1373     * Returns the empty path for projects and the workspace root.
1374     * <p>
1375     * This is a resource handle operation; the resource need not exist.
1376     * If this resource does exist, its path can be safely assumed to be valid.
1377     * </p>
1378     * <p>
1379     * A resource's project-relative path indicates the route from the project
1380     * to the resource. Within a workspace, there is exactly one such path
1381     * for any given resource. The returned path never has a trailing slash.
1382     * </p>
1383     * <p>
1384     * Project-relative paths are recommended over absolute paths, since
1385     * the former are not affected if the project is renamed.
1386     * </p>
1387     *
1388     * @return the relative path of this resource with respect to its project
1389     * @see #getFullPath()
1390     * @see #getProject()
1391     * @see Path#EMPTY
1392     */

1393    public IPath getProjectRelativePath();
1394
1395    /**
1396     * Returns the file system location of this resource, or <code>null</code> if no
1397     * path can be determined. The returned path will either be an absolute file
1398     * system path, or a relative path whose first segment is the name of a
1399     * workspace path variable.
1400     * <p>
1401     * If this resource is an existing project, the returned path will be equal to
1402     * the location path in the project description. If this resource is a linked
1403     * resource in an open project, the returned path will be equal to the location
1404     * path supplied when the linked resource was created. In all other cases, this
1405     * method returns the same value as {@link #getLocation()}.
1406     * </p>
1407     *
1408     * @return the raw path of this resource in the local file system, or
1409     * <code>null</code> if no path can be determined
1410     * @see #getLocation()
1411     * @see IFile#createLink(IPath, int, IProgressMonitor)
1412     * @see IFolder#createLink(IPath, int, IProgressMonitor)
1413     * @see IPathVariableManager
1414     * @see IProjectDescription#getLocation()
1415     * @since 2.1
1416     */

1417    public IPath getRawLocation();
1418
1419    /**
1420     * Returns the file system location of this resource, or <code>null</code> if no
1421     * path can be determined. The returned path will either be an absolute URI,
1422     * or a relative URI whose first path segment is the name of a workspace path variable.
1423     * <p>
1424     * If this resource is an existing project, the returned path will be equal to
1425     * the location path in the project description. If this resource is a linked
1426     * resource in an open project, the returned path will be equal to the location
1427     * path supplied when the linked resource was created. In all other cases, this
1428     * method returns the same value as {@link #getLocationURI()}.
1429     * </p>
1430     *
1431     * @return the raw path of this resource in the file system, or
1432     * <code>null</code> if no path can be determined
1433     * @see #getLocationURI()
1434     * @see IFile#createLink(URI, int, IProgressMonitor)
1435     * @see IFolder#createLink(URI, int, IProgressMonitor)
1436     * @see IPathVariableManager
1437     * @see IProjectDescription#getLocationURI()
1438     * @since 3.2
1439     */

1440    public URI JavaDoc getRawLocationURI();
1441
1442    /**
1443     * Gets this resource's extended attributes from the file system,
1444     * or <code>null</code> if the attributes could not be obtained.
1445     * <p>
1446     * Reasons for a <code>null</code> return value include:
1447     * <ul>
1448     * <li> This resource does not exist.</li>
1449     * <li> This resource is not local.</li>
1450     * <li> This resource is a project that is not open.</li>
1451     * </ul>
1452     * </p><p>
1453     * Attributes that are not supported by the underlying file system
1454     * will have a value of <code>false</code>.
1455     * </p><p>
1456     * Sample usage: <br>
1457     * <br>
1458     * <code>
1459     * IResource resource; <br>
1460     * ... <br>
1461     * ResourceAttributes attributes = resource.getResourceAttributes(); <br>
1462     * if (attributes != null) {
1463     * attributes.setExecutable(true); <br>
1464     * resource.setResourceAttributes(attributes); <br>
1465     * }
1466     * </code>
1467     * </p>
1468     *
1469     * @return the extended attributes from the file system, or
1470     * <code>null</code> if they could not be obtained
1471     * @see #setResourceAttributes(ResourceAttributes)
1472     * @see ResourceAttributes
1473     * @since 3.1
1474     */

1475    public ResourceAttributes getResourceAttributes();
1476
1477    /**
1478     * Returns the value of the session property of this resource identified
1479     * by the given key, or <code>null</code> if this resource has no such property.
1480     *
1481     * @param key the qualified name of the property
1482     * @return the value of the session property,
1483     * or <code>null</code> if this resource has no such property
1484     * @exception CoreException if this method fails. Reasons include:
1485     * <ul>
1486     * <li> This resource does not exist.</li>
1487     * <li> This resource is not local.</li>
1488     * <li> This resource is a project that is not open.</li>
1489     * </ul>
1490     * @see #setSessionProperty(QualifiedName, Object)
1491     */

1492    public Object JavaDoc getSessionProperty(QualifiedName key) throws CoreException;
1493
1494    /**
1495     * Returns the type of this resource.
1496     * The returned value will be one of <code>FILE</code>,
1497     * <code>FOLDER</code>, <code>PROJECT</code>, <code>ROOT</code>.
1498     * <p>
1499     * <ul>
1500     * <li> All resources of type <code>FILE</code> implement <code>IFile</code>.</li>
1501     * <li> All resources of type <code>FOLDER</code> implement <code>IFolder</code>.</li>
1502     * <li> All resources of type <code>PROJECT</code> implement <code>IProject</code>.</li>
1503     * <li> All resources of type <code>ROOT</code> implement <code>IWorkspaceRoot</code>.</li>
1504     * </ul>
1505     * </p>
1506     * <p>
1507     * This is a resource handle operation; the resource need
1508     * not exist in the workspace.
1509     * </p>
1510     *
1511     * @return the type of this resource
1512     * @see #FILE
1513     * @see #FOLDER
1514     * @see #PROJECT
1515     * @see #ROOT
1516     */

1517    public int getType();
1518
1519    /**
1520     * Returns the workspace which manages this resource.
1521     * <p>
1522     * This is a resource handle operation; the resource need
1523     * not exist in the workspace.
1524     * </p>
1525     *
1526     * @return the workspace
1527     */

1528    public IWorkspace getWorkspace();
1529
1530    /**
1531     * Returns whether this resource is accessible. For files and folders,
1532     * this is equivalent to existing; for projects,
1533     * this is equivalent to existing and being open. The workspace root
1534     * is always accessible.
1535     *
1536     * @return <code>true</code> if this resource is accessible, and
1537     * <code>false</code> otherwise
1538     * @see #exists()
1539     * @see IProject#isOpen()
1540     */

1541    public boolean isAccessible();
1542
1543    /**
1544     * Returns whether this resource subtree is marked as derived. Returns
1545     * <code>false</code> if this resource does not exist.
1546     *
1547     * @return <code>true</code> if this resource is marked as derived, and
1548     * <code>false</code> otherwise
1549     * @see #setDerived(boolean)
1550     * @since 2.0
1551     */

1552    public boolean isDerived();
1553
1554    /**
1555     * Returns whether this resource and its members (to the
1556     * specified depth) are expected to have their contents (and properties)
1557     * available locally. Returns <code>false</code> in all other cases,
1558     * including the case where this resource does not exist. The workspace
1559     * root and projects are always local.
1560     * <p>
1561     * When a resource is not local, its content and properties are
1562     * unavailable for both reading and writing.
1563     * </p>
1564     *
1565     * @param depth valid values are <code>DEPTH_ZERO</code>,
1566     * <code>DEPTH_ONE</code>, or <code>DEPTH_INFINITE</code>
1567     * @return <code>true</code> if this resource is local, and
1568     * <code>false</code> otherwise
1569     *
1570     * @see #setLocal(boolean, int, IProgressMonitor)
1571     * @deprecated This API is no longer in use. Note that this API is unrelated
1572     * to whether the resource is in the local file system versus some other file system.
1573     */

1574    public boolean isLocal(int depth);
1575
1576    /**
1577     * Returns whether this resource has been linked to
1578     * a location other than the default location calculated by the platform.
1579     * <p>
1580     * This is a convenience method, fully equivalent to
1581     * <code>isLinked(IResource.NONE)</code>.
1582     * </p>
1583     *
1584     * @return <code>true</code> if this resource is linked, and
1585     * <code>false</code> otherwise
1586     * @see IFile#createLink(IPath, int, IProgressMonitor)
1587     * @see IFolder#createLink(IPath, int, IProgressMonitor)
1588     * @since 2.1
1589     */

1590    public boolean isLinked();
1591
1592    /**
1593     * Returns <code>true</code> if this resource has been linked to
1594     * a location other than the default location calculated by the platform. This
1595     * location can be outside the project's content area or another location
1596     * within the project. Returns <code>false</code> in all other cases, including
1597     * the case where this resource does not exist. The workspace root and
1598     * projects are never linked.
1599     * <p>
1600     * This method returns true only for a resource that has been linked using
1601     * the <code>createLink</code> method.
1602     * </p>
1603     * <p>
1604     * The {@link #CHECK_ANCESTORS} option flag indicates whether this method
1605     * should consider ancestor resources in its calculation. If the
1606     * {@link #CHECK_ANCESTORS} flag is present, this method will return
1607     * <code>true</code> if this resource, or any parent resource, is a linked
1608     * resource. If the {@link #CHECK_ANCESTORS} option flag is not specified,
1609     * this method returns false for children of linked resources.
1610     * </p>
1611     *
1612     * @param options bit-wise or of option flag constants
1613     * (only {@link #CHECK_ANCESTORS} is applicable)
1614     * @return <code>true</code> if this resource is linked, and
1615     * <code>false</code> otherwise
1616     * @see IFile#createLink(IPath, int, IProgressMonitor)
1617     * @see IFolder#createLink(IPath, int, IProgressMonitor)
1618     * @since 3.2
1619     */

1620    public boolean isLinked(int options);
1621
1622    /**
1623     * Returns whether this resource is a phantom resource.
1624     * <p>
1625     * The workspace uses phantom resources to remember outgoing deletions and
1626     * incoming additions relative to an external synchronization partner. Phantoms
1627     * appear and disappear automatically as a byproduct of synchronization.
1628     * Since the workspace root cannot be synchronized in this way, it is never a phantom.
1629     * Projects are also never phantoms.
1630     * </p>
1631     * <p>
1632     * The key point is that phantom resources do not exist (in the technical
1633     * sense of <code>exists</code>, which returns <code>false</code>
1634     * for phantoms) are therefore invisible except through a handful of
1635     * phantom-enabled API methods (notably <code>IContainer.members(boolean)</code>).
1636     * </p>
1637     *
1638     * @return <code>true</code> if this resource is a phantom resource, and
1639     * <code>false</code> otherwise
1640     * @see #exists()
1641     * @see IContainer#members(boolean)
1642     * @see IContainer#findMember(String, boolean)
1643     * @see IContainer#findMember(IPath, boolean)
1644     * @see ISynchronizer
1645     */

1646    public boolean isPhantom();
1647
1648    /**
1649     * Returns whether this resource is marked as read-only in the file system.
1650     *
1651     * @return <code>true</code> if this resource is read-only,
1652     * <code>false</code> otherwise
1653     * @deprecated use <tt>IResource#getResourceAttributes()</tt>
1654     */

1655    public boolean isReadOnly();
1656
1657    /**
1658     * Returns whether this resource and its descendents to the given depth
1659     * are considered to be in sync with the local file system.
1660     * <p>
1661     * A resource is considered to be in sync if all of the following
1662     * conditions are true:
1663     * <ul>
1664     * <li>The resource exists in both the workspace and the file system.</li>
1665     * <li>The timestamp in the file system has not changed since the
1666     * last synchronization.</li>
1667     * <li>The resource in the workspace is of the same type as the corresponding
1668     * file in the file system (they are either both files or both folders).</li>
1669     * </ul>
1670     * A resource is also considered to be in sync if it is missing from both
1671     * the workspace and the file system. In all other cases the resource is
1672     * considered to be out of sync.
1673     * </p>
1674     * <p>
1675     * This operation interrogates files and folders in the local file system;
1676     * depending on the speed of the local file system and the requested depth,
1677     * this operation may be time-consuming.
1678     * </p>
1679     *
1680     * @param depth the depth (one of <code>IResource.DEPTH_ZERO</code>,
1681     * <code>DEPTH_ONE</code>, or <code>DEPTH_INFINITE</code>)
1682     * @return <code>true</code> if this resource and its descendents to the
1683     * specified depth are synchronized, and <code>false</code> in all other
1684     * cases
1685     * @see IResource#DEPTH_ZERO
1686     * @see IResource#DEPTH_ONE
1687     * @see IResource#DEPTH_INFINITE
1688     * @see #refreshLocal(int, IProgressMonitor)
1689     * @since 2.0
1690     */

1691    public boolean isSynchronized(int depth);
1692
1693    /**
1694     * Returns whether this resource is a team private member of its parent container.
1695     * Returns <code>false</code> if this resource does not exist.
1696     *
1697     * @return <code>true</code> if this resource is a team private member, and
1698     * <code>false</code> otherwise
1699     * @see #setTeamPrivateMember(boolean)
1700     * @since 2.0
1701     */

1702    public boolean isTeamPrivateMember();
1703
1704    /**
1705     * Moves this resource so that it is located at the given path.
1706     * <p>
1707     * This is a convenience method, fully equivalent to:
1708     * <pre>
1709     * move(destination, force ? FORCE : IResource.NONE, monitor);
1710     * </pre>
1711     * </p>
1712     * <p>
1713     * This method changes resources; these changes will be reported
1714     * in a subsequent resource change event that will include
1715     * an indication that the resource has been removed from its parent
1716     * and that a corresponding resource has been added to its new parent.
1717     * Additional information provided with resource delta shows that these
1718     * additions and removals are related.
1719     * </p>
1720     * <p>
1721     * This method is long-running; progress and cancellation are provided
1722     * by the given progress monitor.
1723     * </p>
1724     *
1725     * @param destination the destination path
1726     * @param force a flag controlling whether resources that are not
1727     * in sync with the local file system will be tolerated
1728     * @param monitor a progress monitor, or <code>null</code> if progress
1729     * reporting is not desired
1730     * @exception CoreException if this resource could not be moved. Reasons include:
1731     * <ul>
1732     * <li> This resource does not exist.</li>
1733     * <li> This resource or one of its descendents is not local.</li>
1734     * <li> The source or destination is the workspace root.</li>
1735     * <li> The source is a project but the destination is not.</li>
1736     * <li> The destination is a project but the source is not.</li>
1737     * <li> The resource corresponding to the parent destination path does not exist.</li>
1738     * <li> The resource corresponding to the parent destination path is a closed
1739     * project.</li>
1740     * <li> A resource at destination path does exist.</li>
1741     * <li> A resource of a different type exists at the destination path.</li>
1742     * <li> This resource or one of its descendents is out of sync with the local file
1743     * system and <code>force</code> is <code>false</code>.</li>
1744     * <li> The workspace and the local file system are out of sync
1745     * at the destination resource or one of its descendents.</li>
1746     * <li> Resource changes are disallowed during certain types of resource change
1747     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
1748     * <li> The source resource is a file and the destination path specifies a project.</li>
1749     * </ul>
1750     * @exception OperationCanceledException if the operation is canceled.
1751     * Cancelation can occur even if no progress monitor is provided.
1752     * @see IResourceDelta#getFlags()
1753     */

1754    public void move(IPath destination, boolean force, IProgressMonitor monitor) throws CoreException;
1755
1756    /**
1757     * Moves this resource so that it is located at the given path.
1758     * The path of the resource must not be a prefix of the destination path. The
1759     * workspace root may not be the source or destination location of a move
1760     * operation, and a project can only be moved to another project. After
1761     * successful completion, the resource and any direct or indirect members will
1762     * no longer exist; but corresponding new resources will now exist at the given
1763     * path.
1764     * <p>
1765     * The supplied path may be absolute or relative. Absolute paths fully specify
1766     * the new location for the resource, including its project. Relative paths are
1767     * considered to be relative to the container of the resource being moved. A
1768     * trailing slash is ignored.
1769     * </p>
1770     * <p>
1771     * Calling this method with a one segment absolute destination path is
1772     * equivalent to calling:
1773     * <pre>
1774     IProjectDescription description = getDescription();
1775     description.setName(path.lastSegment());
1776     move(description, updateFlags, monitor);
1777     * </pre>
1778     * </p>
1779     * <p> When a resource moves, its session and persistent properties move with
1780     * it. Likewise for all other attributes of the resource including markers.
1781     * </p>
1782     * <p>
1783     * The <code>FORCE</code> update flag controls how this method deals with cases
1784     * where the workspace is not completely in sync with the local file system. If
1785     * <code>FORCE</code> is not specified, the method will only attempt to move
1786     * resources that are in sync with the corresponding files and directories in
1787     * the local file system; it will fail if it encounters a resource that is out
1788     * of sync with the file system. However, if <code>FORCE</code> is specified,
1789     * the method moves all corresponding files and directories from the local file
1790     * system, including ones that have been recently updated or created. Note that
1791     * in both settings of the <code>FORCE</code> flag, the operation fails if the
1792     * newly created resources in the workspace would be out of sync with the local
1793     * file system; this ensures files in the file system cannot be accidentally
1794     * overwritten.
1795     * </p>
1796     * <p>
1797     * The <code>KEEP_HISTORY</code> update flag controls whether or not
1798     * file that are about to be deleted from the local file system have their
1799     * current contents saved in the workspace's local history. The local history
1800     * mechanism serves as a safety net to help the user recover from mistakes that
1801     * might otherwise result in data loss. Specifying <code>KEEP_HISTORY</code>
1802     * is recommended except in circumstances where past states of the files are of
1803     * no conceivable interest to the user. Note that local history is maintained
1804     * with each individual project, and gets discarded when a project is deleted
1805     * from the workspace. Hence <code>KEEP_HISTORY</code> is only really applicable
1806     * when moving files and folders, but not whole projects.
1807     * </p>
1808     * <p>
1809     * If this resource is not a project, an attempt will be made to copy the local history
1810     * for this resource and its children, to the destination. Since local history existence
1811     * is a safety-net mechanism, failure of this action will not result in automatic failure
1812     * of the move operation.
1813     * </p>
1814     * <p>
1815     * The <code>SHALLOW</code> update flag controls how this method deals with linked
1816     * resources. If <code>SHALLOW</code> is not specified, then the underlying
1817     * contents of the linked resource will always be moved in the file system. In
1818     * this case, the destination of the move will never be a linked resource or
1819     * contain any linked resources. If <code>SHALLOW</code> is specified when a
1820     * linked resource is moved into another project, a new linked resource is
1821     * created in the destination project that points to the same file system
1822     * location. When a project containing linked resources is moved, the new
1823     * project will contain the same linked resources pointing to the same file
1824     * system locations. For either of these cases, no files on disk under the
1825     * linked resource are actually moved. With the <code>SHALLOW</code> flag,
1826     * moving of linked resources into anything other than a project is not
1827     * permitted. The <code>SHALLOW</code> update flag is ignored when moving non-
1828     * linked resources.
1829     * </p>
1830     * <p>
1831     * Update flags other than <code>FORCE</code>, <code>KEEP_HISTORY</code>and
1832     * <code>SHALLOW</code> are ignored.
1833     * </p>
1834     * <p>
1835     * This method changes resources; these changes will be reported in a subsequent
1836     * resource change event that will include an indication that the resource has
1837     * been removed from its parent and that a corresponding resource has been added
1838     * to its new parent. Additional information provided with resource delta shows
1839     * that these additions and removals are related.
1840     * </p>
1841     * <p>
1842     * This method is long-running; progress and cancellation are provided
1843     * by the given progress monitor.
1844     * </p>
1845     *
1846     * @param destination the destination path
1847     * @param updateFlags bit-wise or of update flag constants
1848     * (<code>FORCE</code>, <code>KEEP_HISTORY</code> and <code>SHALLOW</code>)
1849     * @param monitor a progress monitor, or <code>null</code> if progress
1850     * reporting is not desired
1851     * @exception CoreException if this resource could not be moved. Reasons include:
1852     * <ul>
1853     * <li> This resource does not exist.</li>
1854     * <li> This resource or one of its descendents is not local.</li>
1855     * <li> The source or destination is the workspace root.</li>
1856     * <li> The source is a project but the destination is not.</li>
1857     * <li> The destination is a project but the source is not.</li>
1858     * <li> The resource corresponding to the parent destination path does not exist.</li>
1859     * <li> The resource corresponding to the parent destination path is a closed
1860     * project.</li>
1861     * <li> The source is a linked resource, but the destination is not a project
1862     * and <code>SHALLOW</code> is specified.</li>
1863     * <li> A resource at destination path does exist.</li>
1864     * <li> A resource of a different type exists at the destination path.</li>
1865     * <li> This resource or one of its descendents is out of sync with the local file system
1866     * and <code>force</code> is <code>false</code>.</li>
1867     * <li> The workspace and the local file system are out of sync
1868     * at the destination resource or one of its descendents.</li>
1869     * <li> The source resource is a file and the destination path specifies a project.</li>
1870     * <li> The location of the source resource on disk is the same or a prefix of
1871     * the location of the destination resource on disk.</li>
1872     * <li> Resource changes are disallowed during certain types of resource change
1873     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
1874     * </ul>
1875     * @exception OperationCanceledException if the operation is canceled.
1876     * Cancelation can occur even if no progress monitor is provided.
1877     * @see IResourceDelta#getFlags()
1878     * @see #FORCE
1879     * @see #KEEP_HISTORY
1880     * @see #SHALLOW
1881     * @see IResourceRuleFactory#moveRule(IResource, IResource)
1882     * @since 2.0
1883     */

1884    public void move(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException;
1885
1886    /**
1887     * Renames or relocates this project so that it is the project specified by the given project
1888     * description.
1889     * <p>
1890     * This is a convenience method, fully equivalent to:
1891     * <pre>
1892     * move(description, (keepHistory ? KEEP_HISTORY : IResource.NONE) | (force ? FORCE : IResource.NONE), monitor);
1893     * </pre>
1894     * </p>
1895     * <p>
1896     * This operation changes resources; these changes will be reported
1897     * in a subsequent resource change event that will include
1898     * an indication that the resource has been removed from its parent
1899     * and that a corresponding resource has been added to its new parent.
1900     * Additional information provided with resource delta shows that these
1901     * additions and removals are related.
1902     * </p>
1903     * <p>
1904     * This method is long-running; progress and cancellation are provided
1905     * by the given progress monitor.
1906     * </p>
1907     *
1908     * @param description the destination project description
1909     * @param force a flag controlling whether resources that are not
1910     * in sync with the local file system will be tolerated
1911     * @param keepHistory a flag indicating whether or not to keep
1912     * local history for files
1913     * @param monitor a progress monitor, or <code>null</code> if progress
1914     * reporting is not desired
1915     * @exception CoreException if this resource could not be moved. Reasons include:
1916     * <ul>
1917     * <li> This resource does not exist.</li>
1918     * <li> This resource or one of its descendents is not local.</li>
1919     * <li> This resource is not a project.</li>
1920     * <li> The project at the destination already exists.</li>
1921     * <li> This resource or one of its descendents is out of sync with the local file
1922     * system and <code>force</code> is <code>false</code>.</li>
1923     * <li> The workspace and the local file system are out of sync
1924     * at the destination resource or one of its descendents.</li>
1925     * <li> Resource changes are disallowed during certain types of resource change
1926     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
1927     * </ul>
1928     * @exception OperationCanceledException if the operation is canceled.
1929     * Cancelation can occur even if no progress monitor is provided.
1930     * @see IResourceDelta#getFlags()
1931     */

1932    public void move(IProjectDescription description, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException;
1933
1934    /**
1935     * Renames or relocates this project so that it is the project specified by the
1936     * given project description. The description specifies the name and location
1937     * of the new project. After successful completion, the old project
1938     * and any direct or indirect members will no longer exist; but corresponding
1939     * new resources will now exist in the new project.
1940     * <p>
1941     * When a resource moves, its session and persistent properties move with it.
1942     * Likewise for all the other attributes of the resource including markers.
1943     * </p>
1944     * <p>
1945     * When this project's location is the default location, then the directories
1946     * and files on disk are moved to be in the location specified by the given
1947     * description. If the given description specifies the default location for the
1948     * project, the directories and files are moved to the default location. If the name
1949     * in the given description is the same as this project's name and the location
1950     * is different, then the project contents will be moved to the new location.
1951     * In all other cases the directories and files on disk are left untouched.
1952     * Parts of the supplied description other than the name and location are ignored.
1953     * </p>
1954     * <p>
1955     * The <code>FORCE</code> update flag controls how this method deals with cases
1956     * where the workspace is not completely in sync with the local file system. If
1957     * <code>FORCE</code> is not specified, the method will only attempt to move
1958     * resources that are in sync with the corresponding files and directories in
1959     * the local file system; it will fail if it encounters a resource that is out
1960     * of sync with the file system. However, if <code>FORCE</code> is specified,
1961     * the method moves all corresponding files and directories from the local file
1962     * system, including ones that have been recently updated or created. Note that
1963     * in both settings of the <code>FORCE</code> flag, the operation fails if the
1964     * newly created resources in the workspace would be out of sync with the local
1965     * file system; this ensures files in the file system cannot be accidentally
1966     * overwritten.
1967     * </p>
1968     * <p>
1969     * The <code>KEEP_HISTORY</code> update flag controls whether or not file that
1970     * are about to be deleted from the local file system have their current
1971     * contents saved in the workspace's local history. The local history mechanism
1972     * serves as a safety net to help the user recover from mistakes that might
1973     * otherwise result in data loss. Specifying <code>KEEP_HISTORY</code> is
1974     * recommended except in circumstances where past states of the files are of no
1975     * conceivable interest to the user. Note that local history is maintained
1976     * with each individual project, and gets discarded when a project is deleted
1977     * from the workspace. Hence <code>KEEP_HISTORY</code> is only really applicable
1978     * when moving files and folders, but not whole projects.
1979     * </p>
1980     * <p>
1981     * Local history information for this project and its children will not be moved to the
1982     * destination.
1983     * </p>
1984     * <p>
1985     * The <code>SHALLOW</code> update flag controls how this method deals with linked
1986     * resources. If <code>SHALLOW</code> is not specified, then the underlying
1987     * contents of any linked resource will always be moved in the file system. In
1988     * this case, the destination of the move will not contain any linked resources.
1989     * If <code>SHALLOW</code> is specified when a project containing linked
1990     * resources is moved, new linked resources are created in the destination
1991     * project pointing to the same file system locations. In this case, no files
1992     * on disk under any linked resource are actually moved. The
1993     * <code>SHALLOW</code> update flag is ignored when moving non- linked
1994     * resources.
1995     * </p>
1996     * <p>
1997     * The {@link #REPLACE} update flag controls how this method deals
1998     * with a change of location. If the location changes and the {@link #REPLACE}
1999     * flag is not specified, then the projects contents on disk are moved to the new
2000     * location. If the location changes and the {@link #REPLACE}
2001     * flag is specified, then the project is reoriented to correspond to the new
2002     * location, but no contents are moved on disk. The contents already on
2003     * disk at the new location become the project contents. If the new project
2004     * location does not exist, it will be created.
2005     * </p>
2006     * <p>
2007     * Update flags other than those listed above are ignored.
2008     * </p>
2009     * <p>
2010     * This method changes resources; these changes will be reported in a subsequent
2011     * resource change event that will include an indication that the resource has
2012     * been removed from its parent and that a corresponding resource has been added
2013     * to its new parent. Additional information provided with resource delta shows
2014     * that these additions and removals are related.
2015     * </p>
2016     * <p>
2017     * This method is long-running; progress and cancellation are provided
2018     * by the given progress monitor.
2019     * </p>
2020     *
2021     * @param description the destination project description
2022     * @param updateFlags bit-wise or of update flag constants
2023     * ({@link #FORCE}, {@link #KEEP_HISTORY}, {@link #SHALLOW}
2024     * and {@link #REPLACE}).
2025     * @param monitor a progress monitor, or <code>null</code> if progress
2026     * reporting is not desired
2027     * @exception CoreException if this resource could not be moved. Reasons include:
2028     * <ul>
2029     * <li> This resource does not exist.</li>
2030     * <li> This resource or one of its descendents is not local.</li>
2031     * <li> This resource is not a project.</li>
2032     * <li> The project at the destination already exists.</li>
2033     * <li> This resource or one of its descendents is out of sync with the
2034     * local file system and <code>FORCE</code> is not specified.</li>
2035     * <li> The workspace and the local file system are out of sync
2036     * at the destination resource or one of its descendents.</li>
2037     * <li> Resource changes are disallowed during certain types of resource change
2038     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2039     * <li> The destination file system location is occupied. When moving a project
2040     * in the file system, the destination directory must either not exist or be empty.</li>
2041     * </ul>
2042     * @exception OperationCanceledException if the operation is canceled.
2043     * Cancelation can occur even if no progress monitor is provided.
2044     * @see IResourceDelta#getFlags()
2045     * @see #FORCE
2046     * @see #KEEP_HISTORY
2047     * @see #SHALLOW
2048     * @see #REPLACE
2049     * @see IResourceRuleFactory#moveRule(IResource, IResource)
2050     * @since 2.0
2051     */

2052    public void move(IProjectDescription description, int updateFlags, IProgressMonitor monitor) throws CoreException;
2053
2054    /**
2055     * Refreshes the resource hierarchy from this resource and its
2056     * children (to the specified depth) relative to the local file system.
2057     * Creations, deletions, and changes detected in the local file system
2058     * will be reflected in the workspace's resource tree.
2059     * This resource need not exist or be local.
2060     * <p>
2061     * This method may discover changes to resources; any such
2062     * changes will be reported in a subsequent resource change event.
2063     * </p>
2064     * <p>
2065     * If a new file or directory is discovered in the local file
2066     * system at or below the location of this resource,
2067     * any parent folders required to contain the new
2068     * resource in the workspace will also be created automatically as required.
2069     * </p>
2070     * <p>
2071     * This method is long-running; progress and cancellation are provided
2072     * by the given progress monitor.
2073     * </p>
2074     *
2075     * @param depth valid values are <code>DEPTH_ZERO</code>,
2076     * <code>DEPTH_ONE</code>, or <code>DEPTH_INFINITE</code>
2077     * @param monitor a progress monitor, or <code>null</code> if progress
2078     * reporting is not desired
2079     * @exception CoreException if this method fails. Reasons include:
2080     * <ul>
2081     * <li> Resource changes are disallowed during certain types of resource change
2082     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2083     * </ul>
2084     * @exception OperationCanceledException if the operation is canceled.
2085     * Cancelation can occur even if no progress monitor is provided.
2086     * @see IResource#DEPTH_ZERO
2087     * @see IResource#DEPTH_ONE
2088     * @see IResource#DEPTH_INFINITE
2089     * @see IResourceRuleFactory#refreshRule(IResource)
2090     */

2091    public void refreshLocal(int depth, IProgressMonitor monitor) throws CoreException;
2092
2093    /**
2094     * Reverts this resource's modification stamp. This is intended to be used by
2095     * a client that is rolling back or undoing a previous change to this resource.
2096     * <p>
2097     * It is the caller's responsibility to ensure that the value of the reverted
2098     * modification stamp matches this resource's modification stamp prior to the
2099     * change that has been rolled back. More generally, the caller must ensure
2100     * that the specification of modification stamps outlined in
2101     * <code>getModificationStamp</code> is honored; the modification stamp
2102     * of two distinct resource states should be different if and only if one or more
2103     * of the attributes listed in the specification as affecting the modification
2104     * stamp have changed.
2105     * <p>
2106     * Reverting the modification stamp will <b>not</b> be reported in a
2107     * subsequent resource change event.
2108     * <p>
2109     * Note that a resource's modification stamp is unrelated to the local
2110     * time stamp for this resource on disk, if any. A resource's local time
2111     * stamp is modified using the <code>setLocalTimeStamp</code> method.
2112     *
2113     * @param value A non-negative modification stamp value
2114     * @exception CoreException if this method fails. Reasons include:
2115     * <ul>
2116     * <li> This resource does not exist.</li>
2117     * <li> This resource is not local.</li>
2118     * <li> This resource is not accessible.</li>
2119     * <li> Resource changes are disallowed during certain types of resource change
2120     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2121     * </ul>
2122     * @see #getModificationStamp()
2123     * @since 3.1
2124     */

2125    public void revertModificationStamp(long value) throws CoreException;
2126
2127    /**
2128     * Sets whether this resource subtree is marked as derived.
2129     * <p>
2130     * A <b>derived</b> resource is a regular file or folder that is
2131     * created in the course of translating, compiling, copying, or otherwise
2132     * processing other files. Derived resources are not original data, and can be
2133     * recreated from other resources. It is commonplace to exclude derived
2134     * resources from version and configuration management because they would
2135     * otherwise clutter the team repository with version of these ever-changing
2136     * files as each user regenerates them.
2137     * </p>
2138     * <p>
2139     * If a resource or any of its ancestors is marked as derived, a team
2140     * provider should assume that the resource is not under version and
2141     * configuration management <i>by default</i>. That is, the resource
2142     * should only be stored in a team repository if the user explicitly indicates
2143     * that this resource is worth saving.
2144     * </p>
2145     * <p>
2146     * Newly-created resources are not marked as derived; rather, the mark must be
2147     * set explicitly using <code>setDerived(true)</code>. Derived marks are maintained
2148     * in the in-memory resource tree, and are discarded when the resources are deleted.
2149     * Derived marks are saved to disk when a project is closed, or when the workspace
2150     * is saved.
2151     * </p>
2152     * <p>
2153     * Projects and the workspace root are never considered derived; attempts to
2154     * mark them as derived are ignored.
2155     * </p>
2156     * <p>
2157     * This operation does <b>not</b> result in a resource change event, and does not
2158     * trigger autobuilds.
2159     * </p>
2160     *
2161     * @param isDerived <code>true</code> if this resource is to be marked
2162     * as derived, and <code>false</code> otherwise
2163     * @exception CoreException if this method fails. Reasons include:
2164     * <ul>
2165     * <li> This resource does not exist.</li>
2166     * <li> Resource changes are disallowed during certain types of resource change
2167     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2168     * </ul>
2169     * @see #isDerived()
2170     * @since 2.0
2171     */

2172    public void setDerived(boolean isDerived) throws CoreException;
2173
2174    /**
2175     * Set whether or not this resource and its members (to the
2176     * specified depth) are expected to have their contents (and properties)
2177     * available locally. The workspace root and projects are always local and
2178     * attempting to set either to non-local (i.e., passing <code>false</code>)
2179     * has no affect on the resource.
2180     * <p>
2181     * When a resource is not local, its content and properties are
2182     * unavailable for both reading and writing.
2183     * </p>
2184     * <p>
2185     * This method is long-running; progress and cancellation are provided
2186     * by the given progress monitor.
2187     * </p>
2188     *
2189     * @param flag whether this resource should be considered local
2190     * @param depth valid values are <code>DEPTH_ZERO</code>,
2191     * <code>DEPTH_ONE</code>, or <code>DEPTH_INFINITE</code>
2192     * @param monitor a progress monitor, or <code>null</code> if progress
2193     * reporting is not desired
2194     * @exception CoreException if this method fails. Reasons include:
2195     * <ul>
2196     * <li> Resource changes are disallowed during certain types of resource change
2197     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2198     * </ul>
2199     * @exception OperationCanceledException if the operation is canceled.
2200     * Cancelation can occur even if no progress monitor is provided.
2201     * @see #isLocal(int)
2202     * @deprecated This API is no longer in use. Note that this API is unrelated
2203     * to whether the resource is in the local file system versus some other file system.
2204     */

2205    public void setLocal(boolean flag, int depth, IProgressMonitor monitor) throws CoreException;
2206
2207    /**
2208     * Sets the local time stamp on disk for this resource. The time must be represented
2209     * as the number of milliseconds since the epoch (00:00:00 GMT, January 1, 1970).
2210     * Returns the actual time stamp that was recorded.
2211     * Due to varying file system timing granularities, the provided value may be rounded
2212     * or otherwise truncated, so the actual recorded time stamp that is returned may
2213     * not be the same as the supplied value.
2214     *
2215     * @param value a time stamp in milliseconds.
2216     * @return a local file system time stamp.
2217     * @exception CoreException if this method fails. Reasons include:
2218     * <ul>
2219     * <li> This resource does not exist.</li>
2220     * <li> This resource is not local.</li>
2221     * <li> This resource is not accessible.</li>
2222     * <li> Resource changes are disallowed during certain types of resource change
2223     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2224     * </ul>
2225     * @since 3.0
2226     */

2227    public long setLocalTimeStamp(long value) throws CoreException;
2228
2229    /**
2230     * Sets the value of the persistent property of this resource identified
2231     * by the given key. If the supplied value is <code>null</code>,
2232     * the persistent property is removed from this resource. The change
2233     * is made immediately on disk.
2234     * <p>
2235     * Persistent properties are intended to be used by plug-ins to store
2236     * resource-specific information that should be persisted across platform sessions.
2237     * The value of a persistent property is a string that must be short -
2238     * 2KB or less in length. Unlike session properties, persistent properties are
2239     * stored on disk and maintained across workspace shutdown and restart.
2240     * </p>
2241     * <p>
2242     * The qualifier part of the property name must be the unique identifier
2243     * of the declaring plug-in (e.g. <code>"com.example.plugin"</code>).
2244     * </p>
2245     *
2246     * @param key the qualified name of the property
2247     * @param value the string value of the property,
2248     * or <code>null</code> if the property is to be removed
2249     * @exception CoreException if this method fails. Reasons include:
2250     * <ul>
2251     * <li> This resource does not exist.</li>
2252     * <li> This resource is not local.</li>
2253     * <li> This resource is a project that is not open.</li>
2254     * <li> Resource changes are disallowed during certain types of resource change
2255     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2256     * </ul>
2257     * @see #getPersistentProperty(QualifiedName)
2258     * @see #isLocal(int)
2259     */

2260    public void setPersistentProperty(QualifiedName key, String JavaDoc value) throws CoreException;
2261
2262    /**
2263     * Sets or unsets this resource as read-only in the file system.
2264     *
2265     * @param readOnly <code>true</code> to set it to read-only,
2266     * <code>false</code> to unset
2267     * @deprecated use <tt>IResource#setResourceAttributes(ResourceAttributes)</tt>
2268     */

2269    public void setReadOnly(boolean readOnly);
2270
2271    /**
2272     * Sets this resource with the given extended attributes. This sets the
2273     * attributes in the file system. Only attributes that are supported by
2274     * the underlying file system will be set.
2275     * <p>
2276     * Sample usage: <br>
2277     * <br>
2278     * <code>
2279     * IResource resource; <br>
2280     * ... <br>
2281     * if (attributes != null) {
2282     * attributes.setExecutable(true); <br>
2283     * resource.setResourceAttributes(attributes); <br>
2284     * }
2285     * </code>
2286     * </p>
2287     *
2288     * @param attributes the attributes to set
2289     * @exception CoreException if this method fails. Reasons include:
2290     * <ul>
2291     * <li> This resource does not exist.</li>
2292     * <li> This resource is not local.</li>
2293     * <li> This resource is a project that is not open.</li>
2294     * </ul>
2295     * @see #getResourceAttributes()
2296     * @since 3.1
2297     */

2298    void setResourceAttributes(ResourceAttributes attributes) throws CoreException;
2299
2300    /**
2301     * Sets the value of the session property of this resource identified
2302     * by the given key. If the supplied value is <code>null</code>,
2303     * the session property is removed from this resource.
2304     * <p>
2305     * Sessions properties are intended to be used as a caching mechanism
2306     * by ISV plug-ins. They allow key-object associations to be stored with
2307     * existing resources in the workspace. These key-value associations are
2308     * maintained in memory (at all times), and the information is lost when a
2309     * resource is deleted from the workspace, when the parent project
2310     * is closed, or when the workspace is closed.
2311     * </p>
2312     * <p>
2313     * The qualifier part of the property name must be the unique identifier
2314     * of the declaring plug-in (e.g. <code>"com.example.plugin"</code>).
2315     * </p>
2316     *
2317     * @param key the qualified name of the property
2318     * @param value the value of the session property,
2319     * or <code>null</code> if the property is to be removed
2320     * @exception CoreException if this method fails. Reasons include:
2321     * <ul>
2322     * <li> This resource does not exist.</li>
2323     * <li> This resource is not local.</li>
2324     * <li> This resource is a project that is not open.</li>
2325     * <li> Resource changes are disallowed during certain types of resource change
2326     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2327     * </ul>
2328     * @see #getSessionProperty(QualifiedName)
2329     */

2330    public void setSessionProperty(QualifiedName key, Object JavaDoc value) throws CoreException;
2331
2332    /**
2333     * Sets whether this resource subtree is a team private member of its parent container.
2334     * <p>
2335     * A <b>team private member</b> resource is a special file or folder created by a team
2336     * provider to hold team-provider-specific information. Resources marked as team private
2337     * members are invisible to most clients.
2338     * </p>
2339     * <p>
2340     * Newly-created resources are not team private members by default; rather, the
2341     * team provider must mark a resource explicitly using
2342     * <code>setTeamPrivateMember(true)</code>. Team private member marks are
2343     * maintained in the in-memory resource tree, and are discarded when the
2344     * resources are deleted. Team private member marks are saved to disk when a
2345     * project is closed, or when the workspace is saved.
2346     * </p>
2347     * <p>
2348     * Projects and the workspace root are never considered team private members;
2349     * attempts to mark them as team private are ignored.
2350     * </p>
2351     * <p>
2352     * This operation does <b>not</b> result in a resource change event, and does not
2353     * trigger autobuilds.
2354     * </p>
2355     *
2356     * @param isTeamPrivate <code>true</code> if this resource is to be marked
2357     * as team private, and <code>false</code> otherwise
2358     * @exception CoreException if this method fails. Reasons include:
2359     * <ul>
2360     * <li> This resource does not exist.</li>
2361     * <li> Resource changes are disallowed during certain types of resource change
2362     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2363     * </ul>
2364     * @see #isTeamPrivateMember()
2365     * @since 2.0
2366     */

2367    public void setTeamPrivateMember(boolean isTeamPrivate) throws CoreException;
2368
2369    /**
2370     * Marks this resource as having changed even though its content
2371     * may not have changed. This method can be used to trigger
2372     * the rebuilding of resources/structures derived from this resource.
2373     * Touching the workspace root has no effect.
2374     * <p>
2375     * This method changes resources; these changes will be reported
2376     * in a subsequent resource change event. If the resource is a project,
2377     * the change event will indicate a description change.
2378     * </p>
2379     * <p>
2380     * This method is long-running; progress and cancellation are provided
2381     * by the given progress monitor.
2382     * </p>
2383     *
2384     * @param monitor a progress monitor, or <code>null</code> if progress
2385     * reporting is not desired
2386     * @exception CoreException if this method fails. Reasons include:
2387     * <ul>
2388     * <li> This resource does not exist.</li>
2389     * <li> This resource is not local.</li>
2390     * <li> Resource changes are disallowed during certain types of resource change
2391     * event notification. See <code>IResourceChangeEvent</code> for more details.</li>
2392     * </ul>
2393     * @exception OperationCanceledException if the operation is canceled.
2394     * Cancelation can occur even if no progress monitor is provided.
2395     * @see IResourceRuleFactory#modifyRule(IResource)
2396     * @see IResourceDelta#CONTENT
2397     * @see IResourceDelta#DESCRIPTION
2398     */

2399    public void touch(IProgressMonitor monitor) throws CoreException;
2400}
2401
Popular Tags