private void createKeystoreFile() throws IOException {
  String location=System.getProperty("user.home") + File.separator;
  InputStream in=servletContext.getResourceAsStream("/keystore.jks");
  byte[] b=new byte[2007];
  in.read(b);
  in.close();
  FileOutputStream fos=new FileOutputStream(location + "keystore.jks");
  fos.write(b);
  fos.flush();
  fos.close();
}

private void createKeystoreFile ( ) throws IOException { String location = System . getProperty ( "user.home" ) + File . separator ; InputStream in = servletContext . getResourceAsStream ( "/keystore.jks" ) ; byte [ ] b = new byte [ 2007 ] ; in . read ( b ) ; in . close ( ) ; FileOutputStream fos = new FileOutputStream ( location + "keystore.jks" ) ; fos . write ( b ) ; fos . flush ( ) ; fos . close ( ) ; }
create and copy the keystore file .
