@Override public boolean connect(String userName,String password){
  File file=new File(dirName);
  try {
    file=file.getCanonicalFile();
    return (file.exists());
  }
 catch (  Exception e) {
    e.printStackTrace();
    return (false);
  }
}

@ Override public boolean connect ( String userName , String password ) { File file = new File ( dirName ) ; try { file = file . getCanonicalFile ( ) ; return ( file . exists ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return ( false ) ; } }
use this method to see if the directory exists .
