public void copyFile(File source, File dest) throws IOException {
        BufferedInputStream bis = null;
        BufferedOutputStream bos = null;
        FileInputStream fis = null;
        FileOutputStream fos = null;

        try {
            fis = new FileInputStream(source);
            fos = new FileOutputStream(dest);

            bis = new BufferedInputStream(fis);
            bos = new BufferedOutputStream(fos);

            byte[] buf = new byte[2048];

            int bytes = bis.read(buf);
            while (bytes != -1) {
                bos.write(buf, 0, bytes);
                bytes = bis.read(buf);
            }
            
            buf = null;
        } finally {
            if (bis != null) {
                try {
                    bis.close();
                } catch (Exception e) {
                    cat.error(e);
                }
            }
            
            if (bos != null) {
                try {
                    bos.close();
                } catch (Exception e) {
                    cat.error(e);
                }
            }
            
            if (fis != null) {
                try {
                    fis.close();
                } catch (Exception e) {
                    cat.error(e);
                }
            }
            
            if (fos != null) {
                try {
                    fos.close();
                } catch (Exception e) {
                    cat.error(e);
                }
            }
        }
    }