From the code your are giving us, the tmp will not be replaced by the String that you want. This happens because when you invoke the replace method, a new String reference is created, which you must set yout tmp to. Meaning you have to write tmp = tmp.replace('.','/');
In case you have difficulty understanding how this whole thing with the String work, try reading this
thread
https://coderanch.com/t/578980/java/java/strings
which has many useful references.