net.sourceforge.ganttproject.document
Interface Document

All Known Implementing Classes:
FileDocument, URLDocument

public interface Document

This interface abstracts the details of file access. Implementations of this interface provide methods to open streams to a project file, indepent of storage location (filesystem / WebDAV).

Author:
Michael Haeusler (michael at akatose.de)

Method Summary
 boolean canRead()
          Checks, wether the document is readable.
 boolean canWrite()
          Checks, wether the document is writable.
 java.lang.String getDescription()
          Gets the description of the document (can be displayed in the application's titlebar).
 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.io.InputStream getInputStream()
          Gets an InputStream, that allows to read from the document.
 java.io.OutputStream getOutputStream()
          Gets an OutputStream, that allows to write to the document.
 java.lang.String getPassword()
          Gets the password used to authenticate to the storage container
 java.lang.String getPath()
          Gets the path to the document.
 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
 

Method Detail

getDescription

public java.lang.String getDescription()
Gets the description of the document (can be displayed in the application's titlebar).

Returns:
the description of the document

canRead

public boolean canRead()
Checks, wether the document is readable.

Returns:
readability

canWrite

public boolean canWrite()
Checks, wether the document is writable.

Returns:
writability

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets an InputStream, that allows to read from the document.

Returns:
InputStream to read from
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Gets an OutputStream, that allows to write to the document.

Returns:
OutputStream to write to
java.io.IOException

getPath

public java.lang.String getPath()
Gets the path to the document.

Returns:
the path to the document

getFilePath

public 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).

Returns:
the path, if the document is a local file; null, otherwise.

getURLPath

public 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).

Returns:
the path, if the document is a server file; null, otherwise.

getUsername

public java.lang.String getUsername()
Gets the username used to authenticate to the storage container

Returns:
username

getPassword

public java.lang.String getPassword()
Gets the password used to authenticate to the storage container

Returns:
username


${copyright}