Remote Systems
v6.4.1

com.ibm.etools.systems.files.importexport.files
Class FileSystemElement

java.lang.Object
  extended bycom.ibm.etools.systems.files.importexport.files.FileSystemElement
All Implemented Interfaces:
IAdaptable
Direct Known Subclasses:
MinimizedFileSystemElement

public class FileSystemElement
extends Object
implements IAdaptable

Instances of this class represent files or file-like entities (eg.- zip file entries) on the local file system. They do not represent resources within the workbench. This distinction is made because the representation of a file system resource is significantly different from that of a workbench resource. If self represents a collection (eg.- file system directory, zip directory) then its icon will be the folderIcon static field. Otherwise (ie.- self represents a file system file) self's icon is stored in field "icon", and is determined by the extension of the file that self represents. This class is adaptable, and implements one adapter itself, namely the IWorkbenchAdapter adapter used for navigation and display in the workbench.


Field Summary
static String Copyright
           
 
Constructor Summary
FileSystemElement(String name, FileSystemElement parent, boolean isDirectory)
          Creates a new FileSystemElement and initializes it and its parent if applicable.
 
Method Summary
 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.
 String getName()
          Returns the name.
 FileSystemElement getParent()
          Return the parent of this element.
 boolean isDirectory()
          Returns true if this element represents a directory, and false otherwise.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

FileSystemElement

public FileSystemElement(String name,
                         FileSystemElement parent,
                         boolean isDirectory)
Creates a new FileSystemElement and initializes it and its parent if applicable.

Parameters:
name - java.lang.String
Method Detail

addChild

public void addChild(FileSystemElement child)
Adds the passed child to this object's collection of children.

Parameters:
child - FileSystemElement

getAdapter

public Object getAdapter(Class adapter)
Returns the adapter

Specified by:
getAdapter in interface IAdaptable

getFileNameExtension

public String getFileNameExtension()
Returns the extension of this element's filename. Returns The empty string if there is no extension.


getFiles

public AdaptableList getFiles()
Answer the files property of this element. Answer an empty list if the files property is null. This method should not be used to add children to the receiver. Use addChild(FileSystemElement) instead.


getFileSystemObject

public Object getFileSystemObject()
Returns the file system object property of this element

Returns:
the file system object

getFolders

public AdaptableList getFolders()
Returns a list of the folders that are immediate children of this folder. Answer an empty list if the folders property is null. This method should not be used to add children to the receiver. Use addChild(FileSystemElement) instead.


getName

public String getName()
Returns the name.


getParent

public FileSystemElement getParent()
Return the parent of this element.

Returns:
the parent file system element, or null if this is the root

isDirectory

public boolean isDirectory()
Returns true if this element represents a directory, and false otherwise.


removeFolder

public void removeFolder(FileSystemElement child)
Removes a sub-folder from this file system element.


setFileSystemObject

public void setFileSystemObject(Object value)
Set the file system object property of this element

Parameters:
value - the file system object

setParent

public void setParent(FileSystemElement element)
Sets the parent of this file system element.


toString

public String toString()
For debugging purposes only.


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.