I am getting file path from database and I want to open that file. I
 received path as
 'D:\Tasks\Electrolux\Asia\XmlToDB\I008\_POK\_ServiceOrder\_201220162609'
 but java treats ':' and '\' as special characters and giving error
 Invalid Character Constant. My expected output is: 'D:\\Tasks/Electrolux/Asia/XmlToDB/I008\_POK\_ServiceOrder\_201220162609' I used replace as below,

```
public static String getFilePath(String path) {

        str_file_name = path.replace('\\', '/');
        str_file_name = str_file_name.replace(':/', '\\'); //getting error here
        return str_file_name;
    }

```