palmed.file
Class Directory

java.lang.Object
  extended by palmed.file.Directory
All Implemented Interfaces:
IDirectory

public final class Directory
extends java.lang.Object
implements IDirectory

This class implements a directory descriptor.

Version:
$Revision: 420 $ $Date: 2006-10-30 18:31:59 +0900 (lun., 30 oct. 2006) $
Author:
Mathieu Champlon

Constructor Summary
Directory(IDirectory parent, java.lang.String path)
          Create a descriptor.
 
Method Summary
 void accept(IDirectoryVisitor visitor)
          Visit the current directory.
 void create(java.lang.String name)
          Create a sub-directory.
 boolean isInPath(java.lang.String name)
          Test if a given name is in the path of the directory.
 boolean isWritable()
          Test if directories or files can be created in this directory.
 IDirectory select(java.lang.String filename, IFileBrowserListener listener)
          Select a file or sub-directory.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Directory

public Directory(IDirectory parent,
                 java.lang.String path)
Create a descriptor.

Parameters:
parent - the parent descriptor
path - the descriptor path
Method Detail

select

public IDirectory select(java.lang.String filename,
                         IFileBrowserListener listener)
Select a file or sub-directory.

Specified by:
select in interface IDirectory
Parameters:
filename - the item name
listener - the file selection listener
Returns:
a descriptor for the item

accept

public void accept(IDirectoryVisitor visitor)
            throws java.io.IOException
Visit the current directory.

Specified by:
accept in interface IDirectory
Parameters:
visitor - the directory visitor
Throws:
java.io.IOException - an io exception occured

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

isWritable

public boolean isWritable()
Test if directories or files can be created in this directory.

Specified by:
isWritable in interface IDirectory
Returns:
whether directories or files can be created

create

public void create(java.lang.String name)
            throws java.io.IOException
Create a sub-directory.

Specified by:
create in interface IDirectory
Parameters:
name - the sub-directory name
Throws:
java.io.IOException - an io exception occured

isInPath

public boolean isInPath(java.lang.String name)
Test if a given name is in the path of the directory.

Specified by:
isInPath in interface IDirectory
Parameters:
name - the name to test
Returns:
whether the name is part of the path of the directory or not


Copyright © 2004-2006 PalmEd. All Rights Reserved.