How to download a file from Hadoop


My application has upload and download option. Im uploading the files to the Hadoop server. It is working fine. Now I need to download the same file. I have that particular file path, which loads the image when it is requested from the browser.

How can I download that file thru vaadin. Im using the below code. But it is not working.

public class FileDownloadResource extends FileResource {

public FileDownloadResource(File sourceFile, Application application) {
	super(sourceFile, application);

public DownloadStream getStream() {
	DownloadStream ds;
	try {
		ds = new DownloadStream(new FileInputStream(
			getSourceFile()), getMIMEType(), getFilename());
		ds.setParameter("Content-Disposition", "attachment; filename=\""+getFilename()+"\"");
		return ds; 
	} catch (FileNotFoundException e1) {
		// TODO Auto-generated catch block
	return null;


On Button Click

String path = “”;
event.getButton().getWindow().open(new FileDownloadResource(new File(path), getApplication()));