All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jnfs.FileServerHandle

java.lang.Object
   |
   +----jnfs.FileServerHandle

public class FileServerHandle
extends Object
A convenience class for dealing with the FileServer and authentication. The FileServerHandle caches user and token info so the user need not specify it as arguments to every call. Used on the client side of the file system.

Version:
$Id: FileServerHandle.java,v 2.29 1997/05/20 17:59:39 mjr Exp $
Author:
Michael John Radwin
See Also:
FileServer

Variable Index

 o server
 o token

Constructor Index

 o FileServerHandle(String, Signer)
Look up the FileServer at hostname and authenticate user using the Signer specified by key.
 o FileServerHandle(String, String)
Look up the FileServer at hostname, load the Signer stored in signerpathname, and authenticate user using that key.
 o FileServerHandle(String, URL)
Look up the FileServer at hostname, load the Signer stored in signerpathname, and authenticate user using that key.

Method Index

 o getFile(File)
Convenience routine for FileServer.getFile().
 o getFile(String)
Convenience routine for FileServer.getFile().
 o getFileInputStream(File)
Convenience routine for FileServer.getFileInputStream().
 o getFileInputStream(String)
Convenience routine for FileServer.getFileInputStream().
 o getFileOutputStream(File)
Convenience routine for FileServer.getFileOutputStream().
 o getFileOutputStream(File, boolean)
Convenience routine for FileServer.getFileOutputStream().
 o getFileOutputStream(String)
Convenience routine for FileServer.getFileOutputStream().
 o getFileOutputStream(String, boolean)
Convenience routine for FileServer.getFileOutputStream().
 o getFileReader(File)
Convenience routine for RemoteFileReader.RemoteFileReader().
 o getFileReader(String)
Convenience routine for RemoteFileReader.RemoteFileReader().
 o getFileWriter(File)
Convenience routine for RemoteFileWriter.RemoteFileWriter().
 o getFileWriter(File, boolean)
Convenience routine for RemoteFileWriter.RemoteFileWriter().
 o getFileWriter(String)
Convenience routine for RemoteFileWriter.RemoteFileWriter().
 o getFileWriter(String, boolean)
Convenience routine for RemoteFileWriter.RemoteFileWriter().
 o getRandomAccessFile(File, String)
Convenience routine for FileServer.getRandomAccessFile().
 o getRandomAccessFile(String, String)
Convenience routine for FileServer.getRandomAccessFile().
 o getRootDirectoryName()
Returns the name of the root of the filesystem for this server
 o getUser(String)
Convenience routine for FileServer.getUser().
 o getUsernames()
Convenience routine for FileServer.getUsernames().
 o getUsers()
Convenience routine for FileServer.getUsers().
 o loadSigner(String)
Loads the signer from pathname on the local filesystem.
 o loadSigner(URL)
Loads the signer from the given URL.
 o putUser(FileSystemUser)
Convenience routine for UserManager.putUser().
 o removeUser(FileSystemUser)
Convenience routine for UserManager.removeUser().
 o removeUser(String)
Convenience routine for UserManager.removeUser().
 o save()
Convenience routine for UserManager.save().

Variables

 o server
 protected FileServer server
 o token
 protected Token token

Constructors

 o FileServerHandle
 public FileServerHandle(String hostname,
                         URL signerURL) throws IOException, UnknownHostException, NotBoundException, RemoteException, InvalidKeyException, AuthenticationException
Look up the FileServer at hostname, load the Signer stored in signerpathname, and authenticate user using that key.

Throws: IOException
if the loading of the Signer in signerpathname fails.
Throws: UnknownHostException
if the FileServer cannot be contacted.
Throws: NotBoundException
if the FileServer cannot be contacted.
Throws: RemoteException
if the FileServer cannot be contacted.
Throws: InvalidKeyException
if the Signer is incompatible with the security algorithm used.
Throws: AuthenticationException
if the authentication of user fails.
 o FileServerHandle
 public FileServerHandle(String hostname,
                         String signerpathname) throws IOException, UnknownHostException, NotBoundException, RemoteException, InvalidKeyException, AuthenticationException
Look up the FileServer at hostname, load the Signer stored in signerpathname, and authenticate user using that key.

Throws: IOException
if the loading of the Signer in signerpathname fails.
Throws: UnknownHostException
if the FileServer cannot be contacted.
Throws: NotBoundException
if the FileServer cannot be contacted.
Throws: RemoteException
if the FileServer cannot be contacted.
Throws: InvalidKeyException
if the Signer is incompatible with the security algorithm used.
Throws: AuthenticationException
if the authentication of user fails.
 o FileServerHandle
 public FileServerHandle(String hostname,
                         Signer signer) throws UnknownHostException, NotBoundException, RemoteException, InvalidKeyException, AuthenticationException
Look up the FileServer at hostname and authenticate user using the Signer specified by key.

Throws: UnknownHostException
if the FileServer cannot be contacted.
Throws: NotBoundException
if the FileServer cannot be contacted.
Throws: RemoteException
if the FileServer cannot be contacted.
Throws: InvalidKeyException
if the Signer is incompatible with the security algorithm used.
Throws: AuthenticationException
if the authentication of user fails.

Methods

 o loadSigner
 public static final Signer loadSigner(URL url) throws IOException
Loads the signer from the given URL.

Throws: IOException
if an I/O error occurs
 o loadSigner
 public static final Signer loadSigner(String pathname) throws IOException
Loads the signer from pathname on the local filesystem.

Throws: IOException
if an I/O error occurs
 o getFile
 public final RemoteFile getFile(String path) throws RemoteException, AuthenticationException, FileTableFullException
Convenience routine for FileServer.getFile(). Requests the RemoteFile from the stored FileServer reference using the stored Token.

Throws: NullPointerException
if the file path is equal to null.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
See Also:
getFile
 o getFile
 public final RemoteFile getFile(File file) throws RemoteException, AuthenticationException, FileTableFullException
Convenience routine for FileServer.getFile(). Requests the RemoteFile from the stored FileServer reference using the stored Token.

Throws: NullPointerException
if the file path is equal to null.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
See Also:
getFile
 o getFileInputStream
 public final RemoteFileInputStream getFileInputStream(String pathname) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getFileInputStream(). Requests the RemoteFileInputStream from the stored FileServer reference using the stored Token.

Throws: IOException
if the file is not found.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of this File argument to see if the application is allowed read access to the file.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getFileInputStream
 o getFileInputStream
 public final RemoteFileInputStream getFileInputStream(File file) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getFileInputStream(). Requests the RemoteFileInputStream from the stored FileServer reference using the stored Token.

Throws: IOException
if the file is not found.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of this File argument to see if the application is allowed read access to the file.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getFileInputStream
 o getFileOutputStream
 public final RemoteFileOutputStream getFileOutputStream(String pathname) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getFileOutputStream(). Requests the RemoteFileOutputStream from the stored FileServer reference using the stored Token.

Throws: IOException
if the file could not be opened for writing.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of the File argument to see if the application is allowed write access to the file. This may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getFileOutputStream
 o getFileOutputStream
 public final RemoteFileOutputStream getFileOutputStream(File file) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getFileOutputStream(). Requests the RemoteFileOutputStream from the stored FileServer reference using the stored Token.

Throws: IOException
if the file could not be opened for writing.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of the File argument to see if the application is allowed write access to the file. This may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getFileOutputStream
 o getFileOutputStream
 public final RemoteFileOutputStream getFileOutputStream(String pathname,
                                                         boolean append) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getFileOutputStream(). Requests the RemoteFileOutputStream from the stored FileServer reference using the stored Token.

Throws: IOException
if the file could not be opened for writing.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of the File argument to see if the application is allowed write access to the file. This may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getFileOutputStream
 o getFileOutputStream
 public final RemoteFileOutputStream getFileOutputStream(File file,
                                                         boolean append) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getFileOutputStream(). Requests the RemoteFileOutputStream from the stored FileServer reference using the stored Token.

Throws: IOException
if the file could not be opened for writing.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of the File argument to see if the application is allowed write access to the file. This may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getFileOutputStream
 o getRandomAccessFile
 public final RemoteRandomAccessFile getRandomAccessFile(String pathname,
                                                         String mode) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getRandomAccessFile(). Requests the RemoteRandomAccessFile from the stored FileServer reference using the stored Token.

Throws: IllegalArgumentException
if the mode argument is not equal to "r" or to "rw".
Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the name argument to see if the application is allowed read access to the file. If the mode argument is equal to "rw", its checkWrite method also is called with the name argument to see if the application is allowed write access to the file. Either of these may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getRandomAccessFile
 o getRandomAccessFile
 public final RemoteRandomAccessFile getRandomAccessFile(File file,
                                                         String mode) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for FileServer.getRandomAccessFile(). Requests the RemoteRandomAccessFile from the stored FileServer reference using the stored Token.

Throws: IllegalArgumentException
if the mode argument is not equal to "r" or to "rw".
Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the name argument to see if the application is allowed read access to the file. If the mode argument is equal to "rw", its checkWrite method also is called with the name argument to see if the application is allowed write access to the file. Either of these may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
getRandomAccessFile
 o getFileReader
 public final RemoteFileReader getFileReader(String pathname) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for RemoteFileReader.RemoteFileReader(). Instantiates a RemoteFileReader using the stored FileServer reference and Token.

Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RemoteFileReader
 o getFileReader
 public final RemoteFileReader getFileReader(File file) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for RemoteFileReader.RemoteFileReader(). Instantiates a RemoteFileReader using the stored FileServer reference and Token.

Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RemoteFileReader
 o getFileWriter
 public final RemoteFileWriter getFileWriter(String pathname) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for RemoteFileWriter.RemoteFileWriter(). Instantiates a RemoteFileWriter using the stored FileServer reference and Token.

Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RemoteFileWriter
 o getFileWriter
 public final RemoteFileWriter getFileWriter(String pathname,
                                             boolean append) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for RemoteFileWriter.RemoteFileWriter(). Instantiates a RemoteFileWriter using the stored FileServer reference and Token.

Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RemoteFileWriter
 o getFileWriter
 public final RemoteFileWriter getFileWriter(File file) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for RemoteFileWriter.RemoteFileWriter(). Instantiates a RemoteFileWriter using the stored FileServer reference and Token.

Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RemoteFileWriter
 o getFileWriter
 public final RemoteFileWriter getFileWriter(File file,
                                             boolean append) throws IOException, AuthenticationException, PermissionDeniedException
Convenience routine for RemoteFileWriter.RemoteFileWriter(). Instantiates a RemoteFileWriter using the stored FileServer reference and Token.

Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RemoteFileWriter
 o getRootDirectoryName
 public final String getRootDirectoryName() throws RemoteException
Returns the name of the root of the filesystem for this server

 o getUsers
 public final Enumeration getUsers() throws RemoteException, AuthenticationException
Convenience routine for FileServer.getUsers().

Throws: AuthenticationException
if the authentication of user fails.
See Also:
getUsers
 o getUsernames
 public final Enumeration getUsernames() throws RemoteException, AuthenticationException
Convenience routine for FileServer.getUsernames().

Throws: AuthenticationException
if the authentication of user fails.
See Also:
getUsernames
 o getUser
 public final FileSystemUser getUser(String name) throws RemoteException, AuthenticationException
Convenience routine for FileServer.getUser().

Throws: AuthenticationException
if the authentication of user fails.
See Also:
getUser
 o putUser
 public final void putUser(FileSystemUser user) throws RemoteException, AuthenticationException
Convenience routine for UserManager.putUser().

Throws: AuthenticationException
if the authentication of admin fails.
See Also:
putUser
 o removeUser
 public final boolean removeUser(FileSystemUser user) throws RemoteException, AuthenticationException
Convenience routine for UserManager.removeUser().

Throws: AuthenticationException
if the authentication of admin fails.
See Also:
removeUser
 o removeUser
 public final boolean removeUser(String username) throws RemoteException, AuthenticationException
Convenience routine for UserManager.removeUser().

Throws: AuthenticationException
if the authentication of admin fails.
See Also:
removeUser
 o save
 public final boolean save() throws RemoteException, AuthenticationException
Convenience routine for UserManager.save().

Throws: AuthenticationException
if the authentication of admin fails.
See Also:
save

All Packages  Class Hierarchy  This Package  Previous  Next  Index