Q:

How to solve sonar issue Absolute Path Traversal in SonaQube? 

In a web application the file path is stored in properties file. 
The path is read from the file, and is passed as a parameter in the URL to call a servlet.  while this path is used in creating a File object, sonar reports issue of Absolute Path Traversal. 

A:

Please try encoding the path that is read from the properties file, before sending it as a parameter in servlet call.  And Decode it before using it in the file object. 
Like: String encodedURL= URLEncoder.encode(pathfromfile,"UTF-8")

