getting error when trying to execute a vaadin code

I am trying to run a demo as mentioned in the url
demo of code
. The first part of demo works fine for me i.e “Myproject Application” gets executed for me well,but when i try to execute the remaining part I get a null pointer exception.Please find below the code and the exception which i get when i try to execute the code


FilesystemContainer docs=new FilesystemContainer(new File("/docs/"));
Select selector=new Select(null,docs);
Label viewer=new Label("select a doc",Label.CONTENT_RAW);
	
@Override
public void init() {
		    Window mainWindow = 
		      new Window("Myproject Application");
		   mainWindow.addComponent(selector);
		   mainWindow.addComponent(viewer);
		   setMainWindow(mainWindow);
		}

The exception which i get is

Please help me with this.I am new to Vaadin

It looks like you have the same problem as in this
thread

I haven’t tried the FilesystemContainer myself but make sure that /docs/ is really a folder on your server (if I understood well, not a URL but a physical folder on the machine the jvm of the server is running on) and you can access it.

Thanks the link/thread you shared partially helps.When i created a folder explicitly in my C:Drive, it works well .But I would like to know how can i execute the code if its with my app?I tried creating the folder in my app,but then i get the same exception.What should i do then?

I haven’t tried but I think you can use the File object returned by application.getContext().getBaseDirectory() to know base the path.