public boolean readFromDefaultLocations() {
        final File home = new File(System.getProperty("user.home"));

        boolean read = false;
        for (String path : new String[] {".ssh/id_rsa", ".ssh/id_dsa", ".ssh/identity"}) {
            final File key = new File(home, path);
            if (!key.exists()) continue;

            try {

                readFrom(key);
                read = true;
            } catch (IOException e) {

                LOGGER.log(FINE, "Failed to load " + key, e);
            } catch (GeneralSecurityException e) {

                LOGGER.log(FINE, "Failed to load " + key, e);
            }
        }

        return read;
    }
public boolean readFromDefaultLocations ( ) { final File home = new File ( System . getProperty ( "user.home" ) ) ; boolean read = false ; for ( String path : new String [ ] { ".ssh/id_rsa" , ".ssh/id_dsa" , ".ssh/identity" } ) { final File key = new File ( home , path ) ; if ( ! key . exists ( ) ) continue ; try { readFrom ( key ) ; read = true ; } catch ( IOException e ) { LOGGER . log ( FINE , "Failed to load " + key , e ) ; } catch ( GeneralSecurityException e ) { LOGGER . log ( FINE , "Failed to load " + key , e ) ; } } return read ; }
Read keys from default keyFiles

{@code .ssh/id_rsa}, {@code .ssh/id_dsa} and {@code .ssh/identity}.

@return true if some key was read successfully.