Examples of NntpException


Examples of org.apache.james.nntpserver.NNTPException

                .append(cleanHeader(msgId))      .append("\t")
                .append(cleanHeader(references)) .append("\t")
                .append(byteCount)               .append("\t")
                .append(lineCount);
            prt.println(line.toString());
        } catch(Exception ex) { throw new NNTPException(ex); }
    }
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            FileInputStream fin = new FileInputStream(articleFile);
            InternetHeaders hdr = new InternetHeaders(fin);
            fin.close();
            return hdr.getHeader(header,null);
        } catch(Exception ex) {
            throw new NNTPException(ex);
        }
    }
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

                prt.println(line);
            }
            prt.close();
            f.renameTo(new File(spool.getSpoolPath(),f.getName()));
        } catch(IOException ex) {
            throw new NNTPException("create article failed",ex);
        }
    }
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            boolean renamed = f.renameTo(new File(spool.getSpoolPath(),f.getName()));
            if (!renamed) {
                throw new IOException("Could not create article on the spool.");
            }
        } catch(IOException ex) {
            throw new NNTPException("create article failed",ex);
        } finally {
            if (fout != null) {
                try {
                    fout.close();
                } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            InternetHeaders headers = new InternetHeaders(fin);
            String[] idheader = headers.getHeader("Message-Id");
            fin.close();
            return ( idheader.length > 0 ) ? idheader[0] : null;
        } catch(Exception ex) {
            throw new NNTPException(ex);
        } finally {
            IOUtil.shutdownStream(fin);
        }
    }
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            int read = 0;
            while ((read = fileStream.read(readBuffer)) > 0) {
                out.write(readBuffer, 0, read);
            }
        } catch(IOException ex) {
            throw new NNTPException(ex);
        } finally {
            if (fileStream != null) {
                try {
                    fileStream.close();
                } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            // Write the headers excluding the final CRLF pair
            if (headerBufferLength > 2) {
                out.write(headerBuffer, 0, (headerBufferLength - 2));
            }
        } catch(Exception ex) {
            throw new NNTPException(ex);
        } finally {
            if (fileStream != null) {
                try {
                    fileStream.close();
                } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            int read = 0;
            while ((read = fileStream.read(readBuffer)) > 0) {
                out.write(readBuffer, 0, read);
            }
        } catch(Exception ex) {
            throw new NNTPException(ex);
        } finally {
            if (fileStream != null) {
                try {
                    fileStream.close();
                } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

                .append(byteCount)               .append("\t")
                .append(lineCount).append("\r\n");
            String lineString = line.toString();
            out.write(lineString.getBytes("ASCII"));
        } catch(Exception ex) {
            throw new NNTPException(ex);
        } finally {
            if (fileStream != null) {
                try {
                    fileStream.close();
                } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.james.nntpserver.NNTPException

            FileInputStream fin = new FileInputStream(articleFile);
            InternetHeaders hdr = new InternetHeaders(fin);
            fin.close();
            return hdr.getHeader(header,null);
        } catch(Exception ex) {
            throw new NNTPException(ex);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.