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
Class VFSFileDescriptor

java.lang.Object
  extended by org.torweg.pulse.vfs.filebrowser.AbstractDescriptor
      extended by org.torweg.pulse.vfs.filebrowser.VFSFileDescriptor
All Implemented Interfaces:
java.lang.Comparable<FileDescriptor>, JDOMable, INamed, FileDescriptor

public class VFSFileDescriptor
extends AbstractDescriptor
implements FileDescriptor

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

Constructor Summary
protected VFSFileDescriptor()
          Default constructor.
  VFSFileDescriptor(VirtualFile f)
          creates a new VFSFileDescriptor for the given VirtualFile.
 
Method Summary
 int compareTo(FileDescriptor f)
          compares the name of the given FileDescriptor with the name of the FileDescriptor.
 org.jdom.Element deserializeToJDOM()
          deserialises the descriptor.
 org.jdom.Element deserializeToJDOM(ServiceRequest request)
          deserialises the descriptor.
 boolean equals(java.lang.Object o)
          compares the VFSFileDescriptor with a given object.
 VirtualFile getFile()
          returns the file.
 java.lang.String getName()
          returns the name of the file.
 java.net.URI getURI()
          returns the URI identifying the file.
 int hashCode()
          returns a hash code for the instance.
 net.sf.json.JSONObject toJSON()
          returns a JSON-representation of the VFSFileDescriptor (which is basically a call on VirtualFile.toJSON()).
 
Methods inherited from class org.torweg.pulse.vfs.filebrowser.AbstractDescriptor
getServiceRequest, insertVirtualFileInformation, setServiceRequest
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.torweg.pulse.vfs.filebrowser.FileDescriptor
setServiceRequest
 

Constructor Detail

VFSFileDescriptor

protected VFSFileDescriptor()
Default constructor.


VFSFileDescriptor

public VFSFileDescriptor(VirtualFile f)
creates a new VFSFileDescriptor for the given VirtualFile.

Parameters:
f - the VirtualFile
Method Detail

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
deserialises the descriptor.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
a JDOM deserialisation

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM(ServiceRequest request)
deserialises the descriptor.

Specified by:
deserializeToJDOM in interface FileDescriptor
Parameters:
request - the current request
Returns:
a JDOM deserialisation

getURI

public final java.net.URI getURI()
returns the URI identifying the file.

Specified by:
getURI in interface FileDescriptor
Returns:
the URI identifying the file

getFile

public final VirtualFile getFile()
returns the file.

Returns:
the file

getName

public java.lang.String getName()
returns the name of the file.

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

compareTo

public final int compareTo(FileDescriptor f)
compares the name of the given FileDescriptor with the name of the FileDescriptor.

Specified by:
compareTo in interface java.lang.Comparable<FileDescriptor>
Parameters:
f - the FileDescriptor to compare with
Returns:
the result of the string comparison

hashCode

public final int hashCode()
returns a hash code for the instance.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for the instance

equals

public final boolean equals(java.lang.Object o)
compares the VFSFileDescriptor with a given object.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare to
Returns:
true, if o is a VFSFileDescriptor with the same URI.

toJSON

public final net.sf.json.JSONObject toJSON()
returns a JSON-representation of the VFSFileDescriptor (which is basically a call on VirtualFile.toJSON()).

Returns:
a JSON-representation of the VFSFileDescriptor
See Also:
VirtualFile.toJSON()