Re: Read file from docroot
Glad to help!
yonestar wrote:
> 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.
>>
>>
>>
>
>