Package com.vaadin.server

Examples of com.vaadin.server.FileResource


        Button b = new Button("Download " + filename);
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                FileResource res = new FileResource(new File(VaadinService
                        .getCurrent().getBaseDirectory() + "/" + filename));
                getMainWindow().open(res);

            }
        });
View Full Code Here


            byte[] b = new byte[writeAtOnce];
            for (int i = 0; i < 5l * 1024l * 1024l; i += writeAtOnce) {
                os.write(b);
            }
            os.close();
            resource = new FileResource(hugeFile);
            addComponents("Huge text file", resource, components);
        } catch (IOException e) {
            e.printStackTrace();
        }
        // resource = new DynamicConnectorResource(this, "requestImage.png");
View Full Code Here

        // Image is only added if present in file system. Will not be there
        // unless manually added!
        File fileResImage = new File("/tmp/test.png");
        if (fileResImage.exists()) {
            list.add(new FileResource(fileResImage));
        }
        return list;
    }
View Full Code Here

TOP

Related Classes of com.vaadin.server.FileResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.