public interface Command
The naming server uses this interface to communicate commands to the storage server.
All methods in this interface may raise NullPointerException
if
passed null
for arguments or SecurityException
if the
security manager on the server does not allow an operation.
Modifier and Type | Method and Description |
---|---|
boolean |
copy(Path file,
Storage server)
Copies a file from another storage server.
|
boolean |
create(Path file)
Creates a file on the storage server.
|
boolean |
delete(Path path)
Deletes a file or directory on the storage server.
|
boolean create(Path file) throws RMIException
file
- Path to the file to be created. The parent directory will be
created if it does not exist. This path may not be the root
directory.true
if the file is created; false
if it cannot be created.RMIException
- If the call cannot be completed due to a network
error.boolean delete(Path path) throws RMIException
If the file is a directory and cannot be deleted, some, all, or none of its contents may be deleted by this operation.
path
- Path to the file or directory to be deleted. The root
directory cannot be deleted.true
if the file or directory is deleted;
false
otherwise.RMIException
- If the call cannot be completed due to a network
error.boolean copy(Path file, Storage server) throws RMIException, java.io.FileNotFoundException, java.io.IOException
file
- Path to the file to be copied.server
- Storage server from which the file is to be downloaded.true
if the file is successfully copied;
false
otherwise.java.io.FileNotFoundException
- If the file is not present on the remote
storage server, or the path refers to a
directory.java.io.IOException
- If an I/O exception occurs either on the remote or
on this storage server.RMIException
- If the call cannot be completed due to a network
error, whether between the caller and this storage
server, or between the two storage servers.