you're using windows so you can't use soft links, but is there way to do that in Win7?
You can create a piping servlet to open the local stream and pump to the servlet output, but this is not the preferred option.
I was referring to the security implication of having a servlet eg /context/FileAccessor/* and return files by converting the '*' to a location relative to (for example) C:\work
If you blindly allow access to files such as /context/FileAcccess/../boot.ini or password files, you could compromise your system
If you take 'any ' path from the request and convert it into a path on your local system, it would potentially allow malicious users to read files that you do not want them to access. Containers like Tomcat protect against resources being read from outside the application, but once you allow this (as you are requesting) then you are now responsible for ensuring this doesn't happen
@Rahul: you haven't really explained your complete requirements. If you're trying to access a file of a known name (like the name is stored in the database as part of a file upload process, for example) then just create the complete file path by supplying the root directory of the uploads and the name of the file stored in the DB. If people are typing in the filename portion then make sure there are no relative directory elements ("..")
Much more beyond that and we'd need to know what you're actually trying to do.