/* File Name: ClientAcceptorImpl.java */ package explorer.client; import java.rmi.*; import explorer.server.*; import explorer.client.CrossXClient; import java.net.*; import java.util.*; import com.sun.xml.tree.*; /** * Class that implements the ClientAcceptor interface * to Authenticate the remote user, * to list the Roots, * to list the files in the given path */ public class ClientAcceptorImpl extends java.rmi.server.UnicastRemoteObject implements ClientAcceptor { public ClientAcceptorImpl() throws RemoteException { super(); } public boolean checkAuthenticate(String username,String password,String domain) throws RemoteException { return true; } /** * Gets the Root File system of the Client system */ public String getRoots() throws RemoteException { CrossXClientBD clientBD=new CrossXClientBD(); return clientBD.getRootFileSystem(); } /** * Lists the Files and Directories present in a given path */ public String listFiles(String path) throws RemoteException { try { CrossXClientBD clientBD=new CrossXClientBD(); return clientBD.listFiles(path); } catch(Exception e) { e.printStackTrace(); return null; } } }