pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.vfs.filebrowser
Interface DirectoryDescriptor

All Superinterfaces:
java.lang.Comparable<DirectoryDescriptor>, INamed, JDOMable
All Known Implementing Classes:
VFSDirectoryDescriptor

public interface DirectoryDescriptor
extends INamed, JDOMable, java.lang.Comparable<DirectoryDescriptor>

represents a DirectoryDescriptor for the FileBrowser.

Version:
$Revision: 1430 $
Author:
Thomas Weber, Daniel Dietz

Method Summary
 Command buildListDirectoriesCommand(Command template, User u, int i)
          builds a Command which lists the child DirectoryDescriptors of the DirectoryDescriptor .
 Command buildListFilesCommand(Command template, User u, int i)
          builds a Command which lists the child FileDescriptors of the DirectoryDescriptor.
 java.util.List<? extends DirectoryDescriptor> getChildren(User u)
          returns the files of the DirectoryDescriptor.
 VirtualFile getDir()
          returns the VirtualFile of the DirectoryDescriptor.
 java.util.List<? extends FileDescriptor> getFiles(User u)
          returns the files of the DirectoryDescriptor.
 java.lang.String getName()
          returns the name of the directory.
 java.net.URI getURI()
          returns the URI for the DirectoryDescriptor.
 void setServiceRequest(ServiceRequest request)
          sets the current ServiceRequest for the descriptor.
 net.sf.json.JSONObject toJSON()
          returns a JSON-representation of the DirectoryDescriptor.
 
Methods inherited from interface org.torweg.pulse.bundle.JDOMable
deserializeToJDOM
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getChildren

java.util.List<? extends DirectoryDescriptor> getChildren(User u)
                                                          throws java.io.IOException
returns the files of the DirectoryDescriptor.

Parameters:
u - the user who is accessing the directory
Returns:
the files of the DirectoryDescriptor
Throws:
java.io.IOException - on I/O errors
See Also:
getFiles(User)

getFiles

java.util.List<? extends FileDescriptor> getFiles(User u)
                                                  throws java.io.IOException
returns the files of the DirectoryDescriptor.

Parameters:
u - the user who is accessing the directory
Returns:
the files of the DirectoryDescriptor
Throws:
java.io.IOException - on I/O errors
See Also:
getFiles(User)

buildListDirectoriesCommand

Command buildListDirectoriesCommand(Command template, User u,
                                    int i)
builds a Command which lists the child DirectoryDescriptors of the DirectoryDescriptor .

Parameters:
template - the Command to be used as a template
u - the User to be used for access checks
i - the id of the BrowsingAdapter
Returns:
a Command which lists the child DirectoryDescriptors of the DirectoryDescriptor or null, if User.hasAllowanceFor(Command) returns false
See Also:
Command

buildListFilesCommand

Command buildListFilesCommand(Command template, User u,
                              int i)
builds a Command which lists the child FileDescriptors of the DirectoryDescriptor.

Parameters:
template - the Command to be used as a template
u - the User to be used for access checks
i - the id of the BrowsingAdapter
Returns:
a Command which lists the child FileDescriptors of the DirectoryDescriptor or null, if User.hasAllowanceFor(Command) returns false
See Also:
Command

getURI

java.net.URI getURI()
returns the URI for the DirectoryDescriptor.

Returns:
the URI for the DirectoryDescriptor

getName

java.lang.String getName()
returns the name of the directory.

Specified by:
getName in interface INamed
Returns:
the name of the directory

setServiceRequest

void setServiceRequest(ServiceRequest request)
sets the current ServiceRequest for the descriptor.

Parameters:
request - the current ServiceRequest

getDir

VirtualFile getDir()
returns the VirtualFile of the DirectoryDescriptor.

Returns:
the VirtualFile of the DirectoryDescriptor

toJSON

net.sf.json.JSONObject toJSON()
returns a JSON-representation of the DirectoryDescriptor.

Returns:
a JSON-representation of the DirectoryDescriptor