Hi,
I've read several comments on this mailing list (like this one: http://
thread.gmane.org/gmane.comp.java.restlet/4423) regarding delivering static
files via Restlet, but I simply did not get it right. Is there anybody out
there be so kind telling me what is wrong with my setup?
I'm using Restlet 1.0.10 with Tomcat 5.5.
web.xml looks like this:
=============================
...
<context-param>
<param-name>org.restlet.application</param-name>
<param-value>de.denic.zone.nast.application.rest.NastApplication</param-value>
</context-param>
<context-param>
<param-name>org.restlet.component</param-name>
<param-value>de.denic.zone.nast.application.rest.MetaFileDeliveringComponent</
param-value>
</context-param>
...
=============================
The configured application works nicely providing all resources as desired.
My component looks like this:
=============================
public final class MetaFileDeliveringComponent extends Component {
private static final class MyApplication extends Application {
private MyApplication(final Context context) {
super(context);
}
@Override
public Restlet createRoot() {
final Directory directory = new Directory(getContext(), "file:///d:/
Temp/");
directory.setDeeplyAccessible(true);
directory.setListingAllowed(true);
return directory;
}
}
public MetaFileDeliveringComponent() {
super();
getClients().add(Protocol.FILE);
getDefaultHost().attach("/meta", new MyApplication(getContext()));
}
=============================
But accessing the /{root-of-webapp}/meta path via GET requests gets code 404
all the time.
Thanks in advance
Christian