private static void extractMessage0(HttpClient hc, GetMethod gm, int n, String path, File outdir) throws HttpException, IOException, MessagingException {
private static void extractMessage0(HttpClient hc, GetMethod gm, String path, File outdir) throws IOException, MessagingException {
    private static void extractMessage0(HttpClient hc, GetMethod gm, int n, String path, File outdir) throws HttpException, IOException, MessagingException {        gm.setPath(path);        if (mLog.isDebugEnabled()) mLog.debug("Fetching " + path);        hc.executeMethod(gm);        if (gm.getStatusCode() != HttpStatus.SC_OK) {            mLog.warn("Fetch status: " + gm.getStatusLine());        }        InputStream is = gm.getResponseBodyAsStream();        MimeMessage mm = new MimeMessage(mJMSession, is);        MimeMultipart mmp = (MimeMultipart)mm.getContent(); // multipart/mixed         BodyPart bp = mmp.getBodyPart(1); // message/rfc822 part        Part msg = (Part) bp.getContent(); // the actual message        File file = new File(outdir, mOutputPrefix + "-" + n);        OutputStream os = new BufferedOutputStream(new FileOutputStream(file));         msg.writeTo(os);        os.close();        if (mLog.isInfoEnabled()) mLog.info("Wrote: " + file);    }