To get the real path we first need the servlet context
ServletContext ctx = (ServletContext) FacesContext.getCurrentInstance() .getExternalContext().getContext();
After getting the servlet context now we are able to get the real path
String deploymentDirectoryPath = ctx.getRealPath("/");
Thanks for this information. I think someone need some help like this.