Package org.apache.james.nntpserver

Examples of org.apache.james.nntpserver.NNTPException


                line = null;
            else if ( line.startsWith(".") )
                 line = line.substring(1,line.length());
            return line;
        } catch(IOException ioe) {
            throw new NNTPException("Could not create article",ioe);
        }
    }
View Full Code Here


            FileInputStream fin = new FileInputStream(articleFile);
            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); }
    }
View Full Code Here

            String line = null;
            while ( ( line = reader.readLine() ) != null ) {
                prt.println(line);
            }
        } catch(IOException ex) {
            throw new NNTPException(ex);
        } finally {
            try {
                if (reader != null) {
                    reader.close();
                }
            } catch (IOException ioe) {
                throw new NNTPException(ioe);
            }
        }
    }
View Full Code Here

                if ( line.trim().length() == 0 )
                    break;
                prt.println(line);
            }
            reader.close();
        } catch(IOException ex) { throw new NNTPException(ex); }
    }
View Full Code Here

                    prt.println(line);
                else
                    startWriting = ( line.trim().length() == 0 );
            }
            reader.close();
        } catch(IOException ex) { throw new NNTPException(ex); }
    }
View Full Code Here

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

            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

            while ( ( line = reader.readLine() ) != null )
                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

        str = str.substring("file://".length());
        str = ((BlockContext)context).getBaseDirectory() +
                File.separator + str;
        File f = new File(str);
        if ( f.exists() && f.isFile() )
            throw new NNTPException("Expecting '"+f.getAbsolutePath()+"' directory");
        if ( f.exists() == false )
            f.mkdirs();
        return f;
    }
View Full Code Here

                line = null;
            else if ( line.startsWith(".") )
                 line = line.substring(1,line.length());
            return line;
        } catch(IOException ioe) {
            throw new NNTPException("could not create article",ioe);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.nntpserver.NNTPException

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.