public interface IFolder extends IContainer, IAdaptable
Folders, like other resource types, may exist in the workspace but not be local; non-local folder resources serve as place-holders for folders whose properties have not yet been fetched from a repository.
Folders implement the IAdaptable
interface;
extensions are managed by the platform's adapter manager.
Platform.getAdapterManager()
DO_NOT_CHECK_EXISTENCE, EXCLUDE_DERIVED, INCLUDE_HIDDEN, INCLUDE_PHANTOMS, INCLUDE_TEAM_PRIVATE_MEMBERS
ALLOW_MISSING_LOCAL, ALWAYS_DELETE_PROJECT_CONTENT, AVOID_NATURE_CONFIG, BACKGROUND_REFRESH, CHECK_ANCESTORS, DEPTH_INFINITE, DEPTH_ONE, DEPTH_ZERO, DERIVED, FILE, FOLDER, FORCE, HIDDEN, KEEP_HISTORY, NEVER_DELETE_PROJECT_CONTENT, NONE, NULL_STAMP, PROJECT, REPLACE, ROOT, SHALLOW, TEAM_PRIVATE, VIRTUAL
Modifier and Type | Method and Description |
---|---|
void |
create(boolean force,
boolean local,
IProgressMonitor monitor)
Creates a new folder resource as a member of this handle's parent resource.
|
void |
create(int updateFlags,
boolean local,
IProgressMonitor monitor)
Creates a new folder resource as a member of this handle's parent resource.
|
void |
createLink(IPath localLocation,
int updateFlags,
IProgressMonitor monitor)
Creates a new folder resource as a member of this handle's parent resource.
|
void |
createLink(URI location,
int updateFlags,
IProgressMonitor monitor)
Creates a new folder resource as a member of this handle's parent resource.
|
void |
delete(boolean force,
boolean keepHistory,
IProgressMonitor monitor)
Deletes this resource from the workspace.
|
IFile |
getFile(String name)
Returns a handle to the file with the given name in this folder.
|
IFolder |
getFolder(String name)
Returns a handle to the folder with the given name in this folder.
|
void |
move(IPath destination,
boolean force,
boolean keepHistory,
IProgressMonitor monitor)
Moves this resource so that it is located at the given path.
|
createFilter, exists, findDeletedMembersWithHistory, findMember, findMember, findMember, findMember, getDefaultCharset, getDefaultCharset, getFile, getFilters, getFolder, members, members, members, setDefaultCharset, setDefaultCharset
accept, accept, accept, accept, accept, clearHistory, copy, copy, copy, copy, createMarker, createProxy, delete, delete, deleteMarkers, equals, exists, findMarker, findMarkers, findMaxProblemSeverity, getFileExtension, getFullPath, getLocalTimeStamp, getLocation, getLocationURI, getMarker, getModificationStamp, getName, getParent, getPathVariableManager, getPersistentProperties, getPersistentProperty, getProject, getProjectRelativePath, getRawLocation, getRawLocationURI, getResourceAttributes, getSessionProperties, getSessionProperty, getType, getWorkspace, isAccessible, isDerived, isDerived, isHidden, isHidden, isLinked, isLinked, isLocal, isPhantom, isReadOnly, isSynchronized, isTeamPrivateMember, isTeamPrivateMember, isVirtual, move, move, move, move, refreshLocal, revertModificationStamp, setDerived, setDerived, setHidden, setLocal, setLocalTimeStamp, setPersistentProperty, setReadOnly, setResourceAttributes, setSessionProperty, setTeamPrivateMember, touch
getAdapter
contains, isConflicting
void create(boolean force, boolean local, IProgressMonitor monitor) throws CoreException
This is a convenience method, fully equivalent to:
create((force ? FORCE : IResource.NONE), local, monitor);
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that the folder has been added to its parent.
This method is long-running; progress and cancellation are provided by the given progress monitor.
force
- a flag controlling how to deal with resources that
are not in sync with the local file systemlocal
- a flag controlling whether or not the folder will be local
after the creationmonitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if this method fails. Reasons include:
IWorkspace.validateName
).force
is false
.IResourceChangeEvent
for more details.OperationCanceledException
- if the operation is canceled.
Cancelation can occur even if no progress monitor is provided.create(int,boolean,IProgressMonitor)
void create(int updateFlags, boolean local, IProgressMonitor monitor) throws CoreException
The FORCE
update flag controls how this method deals with
cases where the workspace is not completely in sync with the local file
system. If FORCE
is not specified, the method will only attempt
to create a directory in the local file system if there isn't one already.
This option ensures there is no unintended data loss; it is the recommended
setting. However, if FORCE
is specified, this method will
be deemed a success even if there already is a corresponding directory.
The IResource.DERIVED
update flag indicates that this resource
should immediately be set as a derived resource. Specifying this flag
is equivalent to atomically calling IResource.setDerived(boolean)
with a value of true
immediately after creating the resource.
The IResource.TEAM_PRIVATE
update flag indicates that this resource
should immediately be set as a team private resource. Specifying this flag
is equivalent to atomically calling IResource.setTeamPrivateMember(boolean)
with a value of true
immediately after creating the resource.
The IResource.HIDDEN
update flag indicates that this resource
should immediately be set as a hidden resource. Specifying this flag
is equivalent to atomically calling IResource.setHidden(boolean)
with a value of true
immediately after creating the resource.
Update flags other than those listed above are ignored.
This method synchronizes this resource with the local file system.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that the folder has been added to its parent.
This method is long-running; progress and cancellation are provided by the given progress monitor.
updateFlags
- bit-wise or of update flag constants
(IResource.FORCE
, IResource.DERIVED
, IResource.TEAM_PRIVATE
)
and IResource.VIRTUAL
)local
- a flag controlling whether or not the folder will be local
after the creationmonitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if this method fails. Reasons include:
IWorkspace.validateName
).FORCE
is not specified.IResourceChangeEvent
for more details.OperationCanceledException
- if the operation is canceled.
Cancelation can occur even if no progress monitor is provided.IResourceRuleFactory.createRule(IResource)
void createLink(IPath localLocation, int updateFlags, IProgressMonitor monitor) throws CoreException
The ALLOW_MISSING_LOCAL
update flag controls how this
method deals with cases where the local file system directory to be linked does
not exist, or is relative to a workspace path variable that is not defined.
If ALLOW_MISSING_LOCAL
is specified, the operation will succeed
even if the local directory is missing, or the path is relative to an
undefined variable. If ALLOW_MISSING_LOCAL
is not specified, the
operation will fail in the case where the local file system directory does
not exist or the path is relative to an undefined variable.
The IResource.REPLACE
update flag controls how this
method deals with cases where a resource of the same name as the
prospective link already exists. If IResource.REPLACE
is specified, then the existing linked resource's location is replaced
by localLocation's value. This does not
cause the underlying file system contents of that resource to be deleted.
If IResource.REPLACE
is not specified, this method will
fail if an existing resource exists of the same name.
The IResource.BACKGROUND_REFRESH
update flag controls how
this method synchronizes the new resource with the filesystem. If this flag is
specified, resources on disk will be synchronized in the background after the
method returns. Child resources of the link may not be available until
this background refresh completes. If this flag is not specified, resources are
synchronized in the foreground before this method returns.
The IResource.HIDDEN
update flag indicates that this resource
should immediately be set as a hidden resource. Specifying this flag
is equivalent to atomically calling IResource.setHidden(boolean)
with a value of true
immediately after creating the resource.
Update flags other than those listed above are ignored.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that the folder has been added to its parent.
This method is long-running; progress and cancellation are provided by the given progress monitor.
localLocation
- a file system path where the folder should be linkedupdateFlags
- bit-wise or of update flag constants
(IResource.ALLOW_MISSING_LOCAL
, IResource.REPLACE
, IResource.BACKGROUND_REFRESH
, and IResource.HIDDEN
)monitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if this method fails. Reasons include:
IWorkspace.validateName
).ALLOW_MISSING_LOCAL
is
not specified.IResourceChangeEvent
for more details.OperationCanceledException
- if the operation is canceled.
Cancelation can occur even if no progress monitor is provided.IResource.isLinked()
,
IResource.ALLOW_MISSING_LOCAL
,
IResource.REPLACE
,
IResource.BACKGROUND_REFRESH
,
IResource.HIDDEN
void createLink(URI location, int updateFlags, IProgressMonitor monitor) throws CoreException
The ALLOW_MISSING_LOCAL
update flag controls how this
method deals with cases where the local file system directory to be linked does
not exist, or is relative to a workspace path variable that is not defined.
If ALLOW_MISSING_LOCAL
is specified, the operation will succeed
even if the local directory is missing, or the path is relative to an
undefined variable. If ALLOW_MISSING_LOCAL
is not specified, the
operation will fail in the case where the local file system directory does
not exist or the path is relative to an undefined variable.
The IResource.REPLACE
update flag controls how this
method deals with cases where a resource of the same name as the
prospective link already exists. If IResource.REPLACE
is specified, then any existing resource with the same name is removed
from the workspace to make way for creation of the link. This does not
cause the underlying file system contents of that resource to be deleted.
If IResource.REPLACE
is not specified, this method will
fail if an existing resource exists of the same name.
The IResource.BACKGROUND_REFRESH
update flag controls how
this method synchronizes the new resource with the filesystem. If this flag is
specified, resources on disk will be synchronized in the background after the
method returns. Child resources of the link may not be available until
this background refresh completes. If this flag is not specified, resources are
synchronized in the foreground before this method returns.
The IResource.HIDDEN
update flag indicates that this resource
should immediately be set as a hidden resource. Specifying this flag
is equivalent to atomically calling IResource.setHidden(boolean)
with a value of true
immediately after creating the resource.
Update flags other than those listed above are ignored.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that the folder has been added to its parent.
This method is long-running; progress and cancellation are provided by the given progress monitor.
location
- a file system path where the folder should be linkedupdateFlags
- bit-wise or of update flag constants
(IResource.ALLOW_MISSING_LOCAL
, IResource.REPLACE
, IResource.BACKGROUND_REFRESH
, and IResource.HIDDEN
)monitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if this method fails. Reasons include:
IWorkspace.validateName
).ALLOW_MISSING_LOCAL
is
not specified.IResourceChangeEvent
for more details.OperationCanceledException
- if the operation is canceled.
Cancelation can occur even if no progress monitor is provided.IResource.isLinked()
,
IResource.ALLOW_MISSING_LOCAL
,
IResource.REPLACE
,
IResource.BACKGROUND_REFRESH
,
IResource.HIDDEN
void delete(boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException
This is a convenience method, fully equivalent to:
delete((keepHistory ? KEEP_HISTORY : IResource.NONE) | (force ? FORCE : IResource.NONE), monitor);
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this folder has been removed from its parent.
This method is long-running; progress and cancellation are provided by the given progress monitor.
force
- a flag controlling whether resources that are not
in sync with the local file system will be toleratedkeepHistory
- a flag controlling whether files under this folder
should be stored in the workspace's local historymonitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if this method fails. Reasons include:
force
is false
.IResourceChangeEvent
for more details.OperationCanceledException
- if the operation is canceled.
Cancelation can occur even if no progress monitor is provided.IResourceRuleFactory.deleteRule(IResource)
,
IResource.delete(int,IProgressMonitor)
IFile getFile(String name)
This is a resource handle operation; neither the resource nor the result need exist in the workspace. The validation check on the resource name/path is not done when the resource handle is constructed; rather, it is done automatically as the resource is created.
name
- the string name of the member filegetFolder(String)
IFolder getFolder(String name)
This is a resource handle operation; neither the container nor the result need exist in the workspace. The validation check on the resource name/path is not done when the resource handle is constructed; rather, it is done automatically as the resource is created.
name
- the string name of the member foldergetFile(String)
void move(IPath destination, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException
This is a convenience method, fully equivalent to:
move(destination, (keepHistory ? KEEP_HISTORY : IResource.NONE) | (force ? FORCE : IResource.NONE), monitor);
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this folder has been removed from its parent and a new folder has been added to the parent of the destination.
This method is long-running; progress and cancellation are provided by the given progress monitor.
destination
- the destination pathforce
- a flag controlling whether resources that are not
in sync with the local file system will be toleratedkeepHistory
- a flag controlling whether files under this folder
should be stored in the workspace's local historymonitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if this resource could not be moved. Reasons include:
force
is false
.IResourceChangeEvent
for more details.OperationCanceledException
- if the operation is canceled.
Cancelation can occur even if no progress monitor is provided.IResourceRuleFactory.moveRule(IResource, IResource)
,
IResource.move(IPath,int,IProgressMonitor)
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.