i wrote a simple class that reads XML document and transforms it into CSV based on XSL style sheet. This process has been working perfectly for days but now the system crashes when i try the transformation process and it produces this error.
(Location of error unknown)java.net.MalformedURLException: unknown protocol: c
java.io.FileNotFoundException: C:\Abbeyleefinal.csv (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
at Simplex.simplexTransform(Simplex.java:41)
It doesn’t understand
C:\as the beginning of a URI. It’s interpretingC:as the scheme, analogous tohttp:, when of course you wantC:to mean drive C.Try
file:///C:/...instead.See also @Michael Kay’s comment about using
File.toURI()to convert a file path to a correct URI.