Skip to Content
0
Nov 24, 2009 at 03:04 PM

File path issues while reading an xsl file in java

68 Views

Hi,

I want to read an xsl file from a java class(which is located in a package com.a.b.c)

xsl file and the java class resides in the same package.(com.a.b.c)

The possible ways that i tried:

String xsltFile = "test.xsl";

String xsltFile = new File("test.xsl").toURL().toExternalForm( );

String xsltFile = new File("test.xsl").getAbsolutePath();

String xsltFile = new File("test.xsl").getPath( );

String xsltFile = "com/a/b/c/test.xsl"

All the above methods returns file path (where the application is deployed) but the actual xsl file doesn't exist there.

How should I read this "xsl file" from my java class which is located in the same path?

Could some one help me out on it?

Thanks & Regards,

Chandana.

Edited by: Chandana Lakku on Nov 25, 2009 7:52 AM