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
-
server
-
-
token
-
-
FileServerHandle(String, Signer)
- Look up the
FileServer at hostname and
authenticate user using the Signer
specified by key.
-
FileServerHandle(String, String)
- Look up the
FileServer at hostname, load the
Signer stored in signerpathname, and
authenticate user using that key.
-
FileServerHandle(String, URL)
- Look up the
FileServer at hostname, load the
Signer stored in signerpathname, and
authenticate user using that key.
-
getFile(File)
-
Convenience routine for
FileServer.getFile().
-
getFile(String)
-
Convenience routine for
FileServer.getFile().
-
getFileInputStream(File)
-
Convenience routine for
FileServer.getFileInputStream().
-
getFileInputStream(String)
-
Convenience routine for
FileServer.getFileInputStream().
-
getFileOutputStream(File)
-
Convenience routine for
FileServer.getFileOutputStream().
-
getFileOutputStream(File, boolean)
-
Convenience routine for
FileServer.getFileOutputStream().
-
getFileOutputStream(String)
-
Convenience routine for
FileServer.getFileOutputStream().
-
getFileOutputStream(String, boolean)
-
Convenience routine for
FileServer.getFileOutputStream().
-
getFileReader(File)
- Convenience routine for
RemoteFileReader.RemoteFileReader().
-
getFileReader(String)
- Convenience routine for
RemoteFileReader.RemoteFileReader().
-
getFileWriter(File)
- Convenience routine for
RemoteFileWriter.RemoteFileWriter().
-
getFileWriter(File, boolean)
- Convenience routine for
RemoteFileWriter.RemoteFileWriter().
-
getFileWriter(String)
- Convenience routine for
RemoteFileWriter.RemoteFileWriter().
-
getFileWriter(String, boolean)
- Convenience routine for
RemoteFileWriter.RemoteFileWriter().
-
getRandomAccessFile(File, String)
-
Convenience routine for
FileServer.getRandomAccessFile().
-
getRandomAccessFile(String, String)
-
Convenience routine for
FileServer.getRandomAccessFile().
-
getRootDirectoryName()
- Returns the name of the root of the filesystem for this server
-
getUser(String)
-
Convenience routine for
FileServer.getUser().
-
getUsernames()
-
Convenience routine for
FileServer.getUsernames().
-
getUsers()
-
Convenience routine for
FileServer.getUsers().
-
loadSigner(String)
- Loads the signer from
pathname on the local filesystem.
-
loadSigner(URL)
- Loads the signer from the given URL.
-
putUser(FileSystemUser)
-
Convenience routine for
UserManager.putUser().
-
removeUser(FileSystemUser)
-
Convenience routine for
UserManager.removeUser().
-
removeUser(String)
-
Convenience routine for
UserManager.removeUser().
-
save()
-
Convenience routine for
UserManager.save().
server
protected FileServer server
token
protected Token token
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.
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.
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
getRootDirectoryName
public final String getRootDirectoryName() throws RemoteException
- Returns the name of the root of the filesystem for this server
getUsers
public final Enumeration getUsers() throws RemoteException, AuthenticationException
- Convenience routine for
FileServer.getUsers().
- Throws: AuthenticationException
- if the authentication
of
user fails.
- See Also:
- getUsers
getUsernames
public final Enumeration getUsernames() throws RemoteException, AuthenticationException
- Convenience routine for
FileServer.getUsernames().
- Throws: AuthenticationException
- if the authentication
of
user fails.
- See Also:
- getUsernames
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
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
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
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
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