I take it that by "module" you mean web application (i.e. deployed in a
separate .war file)? If so you can use the
getServletContext(path).getRealPath(....) methods to get what you want.

Mike.

On 10/23/07, kace <[EMAIL PROTECTED]> wrote:
>
>
> I have the below code which gives me what I want provided I am accessing
> the
> path in the same module.  I am looking to access the exact same directory
> but in another module.  My question is what would i replace
> getServletContext().getRealPath with so it accesses the other module.
>
> String file = request.getParameter("file");
> String uploadDir = getServletContext().getRealPath("/resources/images/");
>
> File imageFile = new File(uploadDir, file);
>
>
> ...kace
>
>
>
>
>
> Ron Anderson wrote:
> >
> > How about something like:
> >
> > File sourceDirectory = new File("/path/to/files");
> > File[] files = sourceDirectory.listFiles();
> >
> > Hi guys,
> >
> > I have a modular project set up where files are uploaded into the
> >  resources
> > folder from the admin module.  The web module needs to access the
> >  resource
> > folder in the admin module(webapp/resources/images).  Is it possible to
> > access a directory in the admin module without going through a
> >  database.
> >
> > getServletContext().getRealPath("/resources/images/"); gets me access
> >  to the
> > files provided im accessing it from within the admin module but I would
> >  like
> > to access it from the other module.
> >
> > Thanks for your time.
> >
> > ..kace
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> >
> http://www.nabble.com/accessing-a-folder-in-modular-setup-tf4680333s2369.html#a13373650
> > Sent from the AppFuse - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Re%3A-accessing-a-folder-in-modular-setup-tf4680377s2369.html#a13374252
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to