Package com.ibm.j2g.jca.connector

Examples of com.ibm.j2g.jca.connector.FileRetrieverConnection


        if (file == null) {
            response.sendError(HttpServletResponse.SC_BAD_REQUEST);
            return;
        }
       
        FileRetrieverConnection connection = null;
        try {
            connection = getConnection();
            response.setContentType("application/x-download");
            response.setHeader("Content-Disposition", "attachment; filename=" + file);
            connection.retrieve(file, response.getOutputStream());
           
        } catch (FileNotFoundException fnfe) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
           
        } catch (Exception e) {
            throw new ServletException(e);
       
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (ResourceException re) {
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.ibm.j2g.jca.connector.FileRetrieverConnection

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.