public class FileSystemElement extends Object implements IAdaptable
Constructor and Description |
---|
FileSystemElement(String name,
FileSystemElement parent,
boolean isDirectory)
Creates a new
FileSystemElement and initializes it and its
parent if applicable. |
Modifier and Type | Method and Description |
---|---|
void |
addChild(FileSystemElement child)
Adds the passed child to this object's collection of children.
|
Object |
getAdapter(Class adapter)
Returns the adapter
|
String |
getFileNameExtension()
Returns the extension of this element's filename.
|
AdaptableList |
getFiles()
Answer the files property of this element.
|
Object |
getFileSystemObject()
Returns the file system object property of this element
|
AdaptableList |
getFolders()
Returns a list of the folders that are immediate children of this folder.
|
FileSystemElement |
getParent()
Return the parent of this element.
|
boolean |
isDirectory() |
void |
removeFolder(FileSystemElement child)
Removes a sub-folder from this file system element.
|
void |
setFileSystemObject(Object value)
Set the file system object property of this element
|
void |
setParent(FileSystemElement element)
Sets the parent of this file system element.
|
String |
toString()
For debugging purposes only.
|
public FileSystemElement(String name, FileSystemElement parent, boolean isDirectory)
FileSystemElement
and initializes it and its
parent if applicable.name
- The name of the elementparent
- The parent element. May be null
isDirectory
- if true
this is representing a directory,
otherwise it is a file.public void addChild(FileSystemElement child)
child
- FileSystemElementpublic Object getAdapter(Class adapter)
getAdapter
in interface IAdaptable
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classpublic String getFileNameExtension()
public AdaptableList getFiles()
public Object getFileSystemObject()
public AdaptableList getFolders()
public FileSystemElement getParent()
null
if this is
the rootpublic boolean isDirectory()
true
if this element represents a
directory, and false
otherwise.public void removeFolder(FileSystemElement child)
child
- The child to remove.public void setFileSystemObject(Object value)
value
- the file system objectpublic void setParent(FileSystemElement element)
element
- The new parent.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.