Package org.jresearch.gossip.beans.forum.attachment

Examples of org.jresearch.gossip.beans.forum.attachment.FileDataInfo


        try {

            st.setInt(1, mess_id);
            rs = (ResultSet) st.executeQuery();
            while (rs.next()) {
                FileDataInfo fileData = new FileDataInfo();
                fileData.setId(rs.getInt("id"));
                fileData.setName(rs.getString("attach_name"));
                fileData.setContentType(rs.getString("attach_content_type"));
                fileData.setDescription(rs.getString("attach_description"));
                fileData.setMessageId(rs.getInt("message_id"));
                fileData.setSize(rs.getInt("attach_size"));
                attachments.add(fileData);
            }
        } finally {
            if (rs != null) {
                rs.close();
View Full Code Here


    public FileDataInfo getAttachmentInfo(int id) throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getForumQueries().getSql_GET_ATTACH_INFO());
        ResultSet rs = null;
        FileDataInfo fileData = new FileDataInfo();

        try {
            st.setInt(1, id);
            rs = (ResultSet) st.executeQuery();

            if (rs.next()) {
                fileData.setId(rs.getInt("id"));
                fileData.setName(rs.getString("attach_name"));
                fileData.setContentType(rs.getString("attach_content_type"));
                fileData.setDescription(rs.getString("attach_description"));
                fileData.setMessageId(rs.getInt("message_id"));
                fileData.setSize(rs.getInt("attach_size"));
            }

            return fileData;
        } finally {
            if (rs != null) {
View Full Code Here

        FileData[] filedata = new FileData[files[0].size()];
        //populate filedata
        for (int i = 0; i < filedata.length; i++) {
            FileData fdata = new FileData();
            FileDataInfo finfo = new FileDataInfo();
            FormFile file = (FormFile) files[0].get(i);

            finfo.setContentType(file.getContentType());
            fdata.setData(file.getFileData());

            finfo.setDescription((String) files[1].get(i));
            finfo.setMessageId(mid);
            finfo.setName(file.getFileName());
            finfo.setSize(file.getFileSize());

            fdata.setInfo(finfo);

            filedata[i] = fdata;
        }
View Full Code Here

            boolean isUserMod = dao.checkMod(Integer.parseInt(aiForm.getFid()),
                    user);
            //          check user access rights
            getServlet().log("check user access rights ");
            if (isUserMod) {
                FileDataInfo fInfo = new FileDataInfo();
                BeanUtils.copyProperties(fInfo, aiForm);
                dao.updateAttachmentInfo(fInfo);
            } else {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }
View Full Code Here

            getServlet().log("check user access rights ");
            if (isUserMod) {
                if(request.getAttribute("attachmentInfoForm")!=null){
                    return mapping.findForward(IConst.TOKEN.PAGE);
                }
                FileDataInfo fInfo = dao.getAttachmentInfo(Integer
                        .parseInt(paForm.getId()));
                if (fInfo == null) {
                    StringBuffer forward = new StringBuffer();
                    forward.append("/ShowMessage.do?fid=");
                    forward.append(paForm.getFid());
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.beans.forum.attachment.FileDataInfo

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.