/[gzz]/gzz/gzz/modules/email/DefaultEmailInStorm.java
ViewVC logotype

Diff of /gzz/gzz/modules/email/DefaultEmailInStorm.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by benja, Tue Nov 12 14:16:27 2002 UTC revision 1.3 by Dreevich, Mon Nov 18 00:09:14 2002 UTC
# Line 83  public class DefaultEmailInStorm impleme Line 83  public class DefaultEmailInStorm impleme
83      }      }
84    
85      protected int nextLine(String str, int curPos) {      protected int nextLine(String str, int curPos) {
86          if (curPos >= (str.length() - 2)) return 0;          if (curPos >= (str.length() - 2)) return str.length();
87          for(; str.charAt(curPos) != '\r'          for(; str.charAt(curPos) != '\r'
88                && str.charAt(curPos + 1) != '\n'                && str.charAt(curPos + 1) != '\n'
89                && curPos != str.length() - 2;                && curPos != str.length() - 2;
# Line 92  public class DefaultEmailInStorm impleme Line 92  public class DefaultEmailInStorm impleme
92      }      }
93    
94      protected int nextHeader(String str, int curPos) {      protected int nextHeader(String str, int curPos) {
95          if (curPos >= (str.length() - 2)) return 0;          if (curPos >= (str.length() - 2)) return str.length();
96          while(str.charAt(curPos) != '\r'          while(str.charAt(curPos) != '\r'
97                && str.charAt(curPos + 1) != '\n') {                && str.charAt(curPos + 1) != '\n') {
98              curPos = nextLine(str, curPos);              curPos = nextLine(str, curPos);
# Line 120  public class DefaultEmailInStorm impleme Line 120  public class DefaultEmailInStorm impleme
120          while(!getFieldBodyString("content-type",          while(!getFieldBodyString("content-type",
121                                    header,                                    header,
122                                    position).trim().startsWith("text/")                                    position).trim().startsWith("text/")
123                && position != 0) {                && position != header.length()) {
124              oldPosition = position;              oldPosition = position;
125              position = nextHeader(header, position);              position = nextHeader(header, position);
126          }          }
127          String id = getFieldBodyString("content-id", header, oldPosition).trim();          String id = getFieldBodyString("content-id", header, oldPosition).trim();
128          if(id.startsWith("storm:block:"))          if(id.startsWith("storm:block:")) {
129             id = id.substring("storm:block:".length());             id = id.substring("storm:block:".length());
130          return (new Mediaserver.Id(id));             return (new Mediaserver.Id(id));
131            } else {
132                return null;
133            }
134      }      }
135    
136      protected String getFieldBodyString(String field,      protected String getFieldBodyString(String field,
# Line 174  public class DefaultEmailInStorm impleme Line 177  public class DefaultEmailInStorm impleme
177                  }                  }
178              }              }
179              position = nextLine(header, position);              position = nextLine(header, position);
180          } while(position != 0);          } while(position != header.length());
181          return positions;          return positions;
182      }      }
183    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26