I think it's helpful:
Application application=new Application(component.getContext()){
@Override
public Restlet createRoot(){
//directory where static web files live
final String
DIR_ROOT_URI="file:///E:/eclipse3.1RC3/workspace/RestletPractice/static_files/";
//create router
Router router=new Router(getContext());
//attach static web files to "www" folder
Directory dir=new Directory(getContext(),DIR_ROOT_URI);
dir.setListingAllowed(true);
dir.setDeeplyAccessible(true);
dir.setNegotiateContent(true);
router.attach("/www/",dir);
//attach resource class:MicroblogResource to
"/restful/blog" as web service URI
router.attach("/restful/blog",MicroblogResource.class);
return router;
}
};
On Sat, Mar 8, 2008 at 5:47 AM, Paul J. Lucas <[EMAIL PROTECTED]> wrote:
> Does anybody use Restlet under Windows? I want my server's root URI
> to be a directory like:
>
> C:\Documents and Settings\pjl\My Documents\My Pictures\
>
> That's held in a File variable. I convert that to a URI then to a
> String like:
>
> String rootURI = rootDir.toURI().toString();
>
> That gives me a URI like:
>
> file:/C:/Documents%20and%20Settings/pjl/My%20Documents/My%20Pictures/
>
> but that doesn't work. I get FileNotFound for all files.
>
> What's the right way to use Windows' directories with Restlet?
>
> - Paul
>
--
cleverpig
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
Phone: 010-66415588-1113
MSN: [EMAIL PROTECTED]
QQ: 149291732
Skype: cleverpigatmatrix
My Facebook ID:cleverpig
My Blog: www.morpheus.org.cn
My Tags: del.icio.us/cleverpig
My Twitter: twitter.com/cleverpig
My Organization: www.beijing-open-party.org
一些值得关注的唧歪:
http://jiwai.de/t/jmatrix/
http://jiwai.de/t/db4o/
http://jiwai.de/t/matrix-community/