|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Folders may be leaf or non-leaf resources and may contain files and/or other folders. A folder resource is stored as a directory in the local file system.
Folders, like other resource types, may exist in the workspace but not be local; non-local folder resources serve as placeholders for folders whose properties have not yet been fetched from a repository.
This interface is not intended to be implemented by clients.
Folders implement the IAdaptable
interface;
extensions are managed by the platform's adapter manager.
Platform.getAdapterManager()
Field Summary |
Fields inherited from interface org.eclipse.core.resources.IContainer |
INCLUDE_PHANTOMS, INCLUDE_TEAM_PRIVATE_MEMBERS |
Fields inherited from interface org.eclipse.core.resources.IResource |
ALWAYS_DELETE_PROJECT_CONTENT, DEPTH_INFINITE, DEPTH_ONE, DEPTH_ZERO, FILE, FOLDER, FORCE, KEEP_HISTORY, NEVER_DELETE_PROJECT_CONTENT, NONE, NULL_STAMP, PROJECT, ROOT |
Method Summary | |
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 |
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. |
Methods inherited from interface org.eclipse.core.resources.IContainer |
exists, findDeletedMembersWithHistory, findMember, findMember, findMember, findMember, getFile, getFolder, members, members, members |
Methods inherited from interface org.eclipse.core.resources.IResource |
accept, accept, accept, clearHistory, copy, copy, copy, copy, createMarker, delete, delete, deleteMarkers, equals, exists, findMarker, findMarkers, getFileExtension, getFullPath, getLocation, getMarker, getModificationStamp, getName, getParent, getPersistentProperty, getProject, getProjectRelativePath, getSessionProperty, getType, getWorkspace, isAccessible, isDerived, isLocal, isPhantom, isReadOnly, isSynchronized, isTeamPrivateMember, move, move, move, move, refreshLocal, setDerived, setLocal, setPersistentProperty, setReadOnly, setSessionProperty, setTeamPrivateMember, touch |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
Method Detail |
public 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 and cancellation are not desired
CoreException
- if this method fails. Reasons include:
IWorkspace.validateName
).force
is false
.create(int,boolean,IProgressMonitor)
public 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.
Update flags other than FORCE
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
(only FORCE
is relevant here)local
- a flag controlling whether or not the folder will be local
after the creationmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if this method fails. Reasons include:
IWorkspace.validateName
).FORCE
is not specified.public 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 and cancellation are not desired
CoreException
- if this method fails. Reasons include:
force
is false
.IResource.delete(int,IProgressMonitor)
public 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 file
getFolder(java.lang.String)
public 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 folder
getFile(java.lang.String)
public 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 and cancellation are not desired
CoreException
- if this resource could not be moved. Reasons include:
force
is false
.IResource.move(IPath,int,IProgressMonitor)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |