/* File Name: FileHandle.java */ package explorer.client; import java.rmi.Remote; import java.rmi.RemoteException; import java.net.InetAddress; import java.io.IOException; import java.io.FileNotFoundException; /** * Interface that contains methods to * Copy a file, * Move a file, * Delete a file, * Set Access Rights, * Rename a file, * create a directory, file, * get remaining bytes to be copied, * get copied no of bytes * */ public interface FileHandle extends Remote { public boolean createOutputStream(InetAddress srcAddress, String destinationFile, int fileSize) throws FileNotFoundException, RemoteException; public boolean copyFileTo(CrossXClient destination, String destinationFile, String srcfile) throws RemoteException; public boolean moveFileTo(CrossXClient destination, String destinationFile, String srcFile) throws RemoteException; public boolean deleteFile(String file) throws RemoteException; public boolean setReadOnly(String file) throws RemoteException; public boolean renameFile(String file, String fileName) throws RemoteException; public boolean mkdir(String file) throws RemoteException; public boolean createFile(String file) throws IOException, RemoteException; /*FILE WRITE FUNCTIONS*/ public void write(InetAddress address, int b) throws IOException, RemoteException; public void write(InetAddress address, byte b[], int off, int len) throws IOException, RemoteException; public void write(InetAddress address, byte b[]) throws IOException, RemoteException; public void close(InetAddress address) throws IOException, RemoteException; /*FILE STATUS FUNCTIONS*/ public int getSize(InetAddress address) throws RemoteException; public int getCopiedBytes(InetAddress address) throws RemoteException; public int getRemainingBytes(InetAddress address) throws IOException, RemoteException; }