Examples of removeFields()


Examples of org.apache.james.mime4j.message.Header.removeFields()

        assertEquals(3, header.getFields().size());
        assertEquals(2, header.getFields("received").size());
        assertEquals(1, header.getFields("Content-Type").size());

        assertEquals(2, header.removeFields("rEcEiVeD"));

        assertEquals(1, header.getFields().size());
        assertEquals(0, header.getFields("received").size());
        assertEquals(1, header.getFields("Content-Type").size());
View Full Code Here

Examples of org.apache.james.mime4j.message.Header.removeFields()

        Header header = new Header();
        header.addField(Field.parse("Received: from foo by bar for james"));
        header.addField(Field.parse("Content-type: text/plain; charset=US-ASCII"));
        header.addField(Field.parse("ReCeIvEd: from bar by foo for james"));

        assertEquals(0, header.removeFields("noSuchField"));

        assertEquals(3, header.getFields().size());
        assertEquals(2, header.getFields("received").size());
        assertEquals(1, header.getFields("Content-Type").size());
    }
View Full Code Here

Examples of org.apache.james.mime4j.message.HeaderImpl.removeFields()

        // copy must have same fields as original
        assertEquals(Arrays.asList(f1, f2, f3), copy.getFields());
        assertEquals(Arrays.asList(f1, f3), copy.getFields("name1"));

        // modify original
        original.removeFields("name1");
        assertEquals(Arrays.asList(f2), original.getFields());

        // copy may not be affected
        assertEquals(Arrays.asList(f1, f2, f3), copy.getFields());
        assertEquals(Arrays.asList(f1, f3), copy.getFields("name1"));
View Full Code Here

Examples of org.apache.james.mime4j.message.HeaderImpl.removeFields()

        assertEquals(3, header.getFields().size());
        assertEquals(2, header.getFields("received").size());
        assertEquals(1, header.getFields("Content-Type").size());

        assertEquals(2, header.removeFields("rEcEiVeD"));

        assertEquals(1, header.getFields().size());
        assertEquals(0, header.getFields("received").size());
        assertEquals(1, header.getFields("Content-Type").size());
View Full Code Here

Examples of org.apache.james.mime4j.message.HeaderImpl.removeFields()

        Header header = new HeaderImpl();
        header.addField(DefaultFieldParser.parse("Received: from foo by bar for james"));
        header.addField(DefaultFieldParser.parse("Content-type: text/plain; charset=US-ASCII"));
        header.addField(DefaultFieldParser.parse("ReCeIvEd: from bar by foo for james"));

        assertEquals(0, header.removeFields("noSuchField"));

        assertEquals(3, header.getFields().size());
        assertEquals(2, header.getFields("received").size());
        assertEquals(1, header.getFields("Content-Type").size());
    }
View Full Code Here

Examples of org.apache.lucene.document.Document.removeFields()

            } else {
              iw.addDocument(doc);
              if (doc.getFields().size() > 1) {
                // back to 1 field
                currentField = field;
                doc.removeFields("dummy");
                doc.add(currentField);
              }
            }
          }
        } catch (Throwable t) {
View Full Code Here

Examples of org.apache.lucene.document.Document.removeFields()

      String split[] = title.split("\\s+");
      for (String trash : split) {
        document.add(new SortedSetDocValuesField("sortedset", new BytesRef(trash)));
      }
      // add a numeric dv field sometimes
      document.removeFields("sparsenumeric");
      if (random.nextInt(4) == 2) {
        document.add(new NumericDocValuesField("sparsenumeric", random.nextInt()));
      }
      writer.addDocument(document);
    }
View Full Code Here

Examples of org.apache.lucene.document.Document.removeFields()

    } else {
      newDoc = doc;
    }
    String crID = (String) config.getName();
    if (crID != null) {
      newDoc.removeFields(CR_FIELD_KEY);
      //Add content repository identification
      newDoc.add(new Field(CR_FIELD_KEY, crID, Field.Store.YES, Field.Index.NOT_ANALYZED));
    }
    if (!"".equals(timestampattribute)) {
      Object updateTimestampObject = resolvable.get(timestampattribute);
View Full Code Here

Examples of org.apache.lucene.document.Document.removeFields()

   
    @Override
    public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
      Document doc = super.document(n, fieldSelector);
      for (String field : fields) {
        doc.removeFields(field);
      }
      return doc;
    }
   
  }
View Full Code Here

Examples of org.apache.lucene.document.Document.removeFields()

    try {
      TopDocs hints = indexSearcher.search(query, MAX_WAVES);
      for (ScoreDoc hint : hints.scoreDocs) {
        Document document = indexSearcher.doc(hint.doc);
        String[] participantValues = document.getValues(WITH.toString());
        document.removeFields(WITH.toString());
        for (String address : participantValues) {
          if (address.equals(participant.getAddress())) {
            continue;
          }
          document.add(new Field(WITH.toString(), address, Field.Store.YES,
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.