You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by do...@apache.org on 2001/03/05 03:15:49 UTC

cvs commit: jakarta-james/src/org/apache/james/mailrepository TownMimeMessageInputStream.java

donaldp     01/03/04 18:15:49

  Modified:    src/org/apache/james/mailrepository
                        TownMimeMessageInputStream.java
  Log:
  Removed tabs, un-globbed imports, added copyright.
  
  Revision  Changes    Path
  1.2       +28 -12    jakarta-james/src/org/apache/james/mailrepository/TownMimeMessageInputStream.java
  
  Index: TownMimeMessageInputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/TownMimeMessageInputStream.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TownMimeMessageInputStream.java	2000/11/24 21:05:21	1.1
  +++ TownMimeMessageInputStream.java	2001/03/05 02:15:49	1.2
  @@ -1,17 +1,33 @@
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.mailrepository;
   
  -import java.io.*;
  -import com.workingdogs.town.*;
  -import org.apache.james.core.*;
  +import com.workingdogs.town.ConnDefinition;
  +import com.workingdogs.town.QueryDataSet;
  +import com.workingdogs.town.Record;
  +import java.io.ByteArrayInputStream;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import org.apache.james.core.JamesMimeMessageInputStream;
   
  -public class TownMimeMessageInputStream extends JamesMimeMessageInputStream {
  +public class TownMimeMessageInputStream 
  +    extends JamesMimeMessageInputStream {
  +
       //Define how to get to the data
       String connDefinition = null;
       String table = null;
       String key = null;
       String repository = null;
   
  -    public TownMimeMessageInputStream(String connDefinition, String table, String key, String repository) throws IOException {
  +    public TownMimeMessageInputStream(String connDefinition, 
  +                                      String table, 
  +                                      String key, 
  +                                      String repository) throws IOException {
           if (connDefinition == null) {
               throw new IOException("Conn definition is null");
           }
  @@ -53,9 +69,9 @@
           //messages.setWhere("message_name='" + key + "' and repository_name='" + repository + "'");
           //messages.setColumns("message_body");
           QueryDataSet messages = new QueryDataSet(ConnDefinition.getInstance(connDefinition),
  -                "SELECT message_body "
  -                + " FROM " + table
  -                + " WHERE message_name='" + key + "' AND repository_name='" + repository + "'");
  +                                                 "SELECT message_body "
  +                                                 + " FROM " + table
  +                                                 + " WHERE message_name='" + key + "' AND repository_name='" + repository + "'");
           if (messages.size() == 0) {
               throw new IOException("Could not find message");
           }
  @@ -67,10 +83,10 @@
           if (obj instanceof TownMimeMessageInputStream) {
               TownMimeMessageInputStream in = (TownMimeMessageInputStream)obj;
               return in.getConnDefinition().equals(connDefinition)
  -                    && in.getTable().equals(table)
  -                    && in.getMessageName().equals(key)
  -                    && in.getRepository().equals(repository);
  +                && in.getTable().equals(table)
  +                && in.getMessageName().equals(key)
  +                && in.getRepository().equals(repository);
           }
           return false;
       }
  -}
  \ No newline at end of file
  +}