Issues with path for java.io.File

I am getting file path in eclipse plugin using \[code\]org.eclipse.swt.widgets.FileDialog\[/code\] and saving the path in XML files.In web.xml , path is stored as below (I can't change backsladh to forwardslash or escape backslash since the value is coming from SWT FileDialog)\[code\]<init-param> <param-name>filePath</param-name> <param-value>c:\new\demo\next\version.txt</param-value></init-param>\[/code\]In my filter , i have below code in init() method but am not able to get File reference due to special characters\[code\]String filePath = filterConfig.getInitParameter("filePath");// Tried filePath.replace('\\','/') --> Didnot work since \n is a single characterFile f = new File(path)\[/code\]
 
Back
Top