net.sourceforge.ganttproject.document
Class AbstractDocument

java.lang.Object
  |
  +--net.sourceforge.ganttproject.document.AbstractDocument
All Implemented Interfaces:
Document
Direct Known Subclasses:
FileDocument, URLDocument

public abstract class AbstractDocument
extends java.lang.Object
implements Document

Author:
Michael Haeusler (michael at akatose.de)

Constructor Summary
AbstractDocument()
           
 
Method Summary
 boolean acquireLock()
          Tries to acquire a lock.
 boolean equals(java.lang.Object o)
           
 java.lang.String getFilePath()
          Gets the path to the document, if it is a file on a local file system (can be used to initialize a JFileChooser).
 java.lang.String getLastError()
          Gets the last error
 java.lang.String getPassword()
          Gets the password used to authenticate to the storage container
 java.lang.String getURLPath()
          Gets the path to the document, if it is a file on a server (can be used to initialize an UrlChooser).
 java.lang.String getUsername()
          Gets the username used to authenticate to the storage container
 void releaseLock()
          Releases a previously acquired lock.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.ganttproject.document.Document
canRead, canWrite, getDescription, getInputStream, getOutputStream, getPath, isValidForMRU
 

Constructor Detail

AbstractDocument

public AbstractDocument()
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

acquireLock

public boolean acquireLock()
Description copied from interface: Document
Tries to acquire a lock.
This method is optional. Storage containers, for which locking is inappropriate, should always return true.

Specified by:
acquireLock in interface Document
Returns:
wether a lock could be successfully acquired
See Also:
Document.releaseLock()

releaseLock

public void releaseLock()
Description copied from interface: Document
Releases a previously acquired lock.

Specified by:
releaseLock in interface Document
See Also:
#acquireLock(String)

getFilePath

public java.lang.String getFilePath()
Description copied from interface: Document
Gets the path to the document, if it is a file on a local file system (can be used to initialize a JFileChooser).

Specified by:
getFilePath in interface Document
Returns:
the path, if the document is a local file; null, otherwise.

getURLPath

public java.lang.String getURLPath()
Description copied from interface: Document
Gets the path to the document, if it is a file on a server (can be used to initialize an UrlChooser).

Specified by:
getURLPath in interface Document
Returns:
the path, if the document is a server file; null, otherwise.

getUsername

public java.lang.String getUsername()
Description copied from interface: Document
Gets the username used to authenticate to the storage container

Specified by:
getUsername in interface Document
Returns:
username

getPassword

public java.lang.String getPassword()
Description copied from interface: Document
Gets the password used to authenticate to the storage container

Specified by:
getPassword in interface Document
Returns:
username

getLastError

public java.lang.String getLastError()
Description copied from interface: Document
Gets the last error

Specified by:
getLastError in interface Document
Returns:
errormessage


Copyright © 2002 Alexandre THOMAS.