users@glassfish.java.net

Re: Read file from docroot

From: yonestar <yoni_at_higtek.com>
Date: Tue, 27 Nov 2007 06:32:17 -0800 (PST)

Byron,

this was exactly what i needed!!
thanks for the "ghastly hack" :-)

Y


Byron Nevins wrote:
>
> This is a ghastly hack but I use it to solve this exact problem.
>
> GlassFish's current directory is *guaranteed* to be <domain-dir>/config
>
> To get to the (default) docroot, I do this:
>
> File docroot = new File("../docroot")
>
> // optional but recommended
> try { docroot = docroot.getCanonicalFile(); }
> catch(IOException e) { docroot = docroot.getAbsoluteFile(); }
>
> It's not a great solution but it's better than hardcoding an absolute
> path.
>
>

-- 
View this message in context: http://www.nabble.com/Read-file-from-docroot-tf4738212.html#a13971780
Sent from the java.net - glassfish users mailing list archive at Nabble.com.