Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Value


  }

  public void testFindProperty_docid() throws RepositoryException {
    Property property = document.findProperty(SpiConstants.PROPNAME_DOCID);
    assertNotNull(property);
    Value value = property.nextValue();
    assertNotNull(value);
    assertEquals(DmInitialize.DM_ID1, value.toString());
  }
View Full Code Here


      property = document.findProperty(SpiConstants.PROPNAME_FOLDER);
    } catch (Exception e) {
      return;
    }
    assertNotNull(property);
    Value value = property.nextValue();
    assertNotNull(value);
  }
View Full Code Here

  public void testFindProperty_objectId() throws RepositoryException {
    Property property =
        document.findProperty(DctmSysobjectDocument.OBJECT_ID_NAME);
    assertNotNull(property);
    Value value = property.nextValue();
    assertNotNull(value);
    assertEquals(DmInitialize.DM_ID1, value.toString());
  }
View Full Code Here

      assertNotNull(typeSet);
      if ("GUID".equals(typeSet)) {
        // GUID is stored as StringValue type
        typeSet = "STRING";
      }
      Value value = valueList.get(0);
      assertTrue(value.getClass().getName().toUpperCase().contains(typeSet));
    }
  }
View Full Code Here

    Calendar cal = Calendar.getInstance();
    cal.setTime(d);
    assertEquals(tz, cal.getTimeZone());

    // Test the checkpoint string.
    Value val = Value.getDateValue(cal);
    SimpleProperty prop = new SimpleProperty(val);
    assertEquals(checkpoint, FileUtil.getQueryTimeString(prop));
  }
View Full Code Here

   * @return String - date time in ISO8601 format including zone
   * @throws RepositoryException
   */
  public static String getQueryTimeString(Property prop)
      throws RepositoryException {
    Value val = prop.nextValue();
    if (prop.nextValue() != null) {
      logger.log(Level.WARNING, "Property contains multivalue datetime");
    }
    return val.toString();
  }
View Full Code Here

      throws RepositoryException {
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      System.out.println();
      for (String name : doc.getPropertyNames()) {
        Value value = doc.findProperty(name).nextValue();
        String printableValue;
        if (value instanceof BinaryValue) {
          try {
            InputStream in = ((BinaryValue) value).getInputStream();
            byte[] buffer = new byte[32];
            int count = in.read(buffer);
            in.close();
            if (count == -1)
              printableValue = "";
            else
              printableValue = new String(buffer);
          } catch (IOException e) {
            printableValue = e.toString();
          }
        } else
          printableValue = value.toString();
        System.out.println(name + " = " + printableValue);
      }
    }
  }
View Full Code Here

    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      System.out.println();
      for (String name : doc.getPropertyNames()) {
        Property prop = doc.findProperty(name);
        Value value;
        while ((value = prop.nextValue()) != null) {
          String printableValue;
          if (value instanceof BinaryValue) {
            try {
              InputStream in = ((BinaryValue) value).getInputStream();
              byte[] buffer = new byte[32];
              int count = in.read(buffer);
              in.close();
              if (count == -1)
                printableValue = "";
              else
                printableValue = new String(buffer, 0, count);
            } catch (IOException e) {
              printableValue = e.toString();
            }
          } else
            printableValue = value.toString();
          System.out.println(name + " = " + printableValue);
        }
      }
    }
  }
View Full Code Here

    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      System.out.println();
      for (String name : doc.getPropertyNames()) {
        Property prop = doc.findProperty(name);
        Value value;
        while ((value = prop.nextValue()) != null) {
          String printableValue;
          if (value instanceof BinaryValue) {
            try {
              InputStream in =
                  ((BinaryValue) value).getInputStream();
              byte[] buffer = new byte[32];
              int count = in.read(buffer);
              in.close();
              if (count == -1)
                printableValue = "";
              else
                printableValue = new String(buffer, 0, count);
            } catch (IOException e) {
              printableValue = e.toString();
            }
          } else
            printableValue = value.toString();
          System.out.println(name + " = " + printableValue);
        }
      }
    }
  }
View Full Code Here

    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      System.out.println();
      for (String name: doc.getPropertyNames()) {
        Property prop = doc.findProperty(name);
        Value value;
        while ((value = prop.nextValue()) != null) {
          String printableValue;
          if (value instanceof BinaryValue) {
            try {
              InputStream in =
                  ((BinaryValue) value).getInputStream();
              byte[] buffer = new byte[32000];
              int count = in.read(buffer);
              in.close();
              if (count == -1)
                printableValue = "";
              else
                printableValue = new String(buffer, 0, count);
            } catch (IOException e) {
              printableValue = e.toString();
            }
          } else
            printableValue = value.toString();
          System.out.println(name + " = " + printableValue);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.Value

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.