private File writePrivateKeyFile() throws GitException {
  final File keyDirectory=new File(rootFolder,host);
  if (!keyDirectory.exists()) {
    keyDirectory.mkdirs();
  }
  final File keyFile=new File(keyDirectory,DEFAULT_KEY_NAME);
  try (FileOutputStream fos=new FileOutputStream(keyFile)){
    fos.write(sshKey);
  }
 catch (  IOException e) {
    LOG.error("Can't store ssh key. ",e);
    throw new GitException("Can't store ssh key. ");
  }
  protectPrivateKeyFile(keyFile);
  return keyFile;
}

private File writePrivateKeyFile ( ) throws GitException { final File keyDirectory = new File ( rootFolder , host ) ; if ( ! keyDirectory . exists ( ) ) { keyDirectory . mkdirs ( ) ; } final File keyFile = new File ( keyDirectory , DEFAULT_KEY_NAME ) ; try ( FileOutputStream fos = new FileOutputStream ( keyFile ) ) { fos . write ( sshKey ) ; } catch ( IOException e ) { LOG . error ( "Can't store ssh key. " , e ) ; throw new GitException ( "Can't store ssh key. " ) ; } protectPrivateKeyFile ( keyFile ) ; return keyFile ; }
writes private ssh key into file .
