Package com.google.enterprise.connector.spiimpl

Examples of com.google.enterprise.connector.spiimpl.BinaryValue


    foo = bar.addFile("foo.html", "contents of foo");
    foo.setLastModified(LAST_MODIFIED.getTimeInMillis());
  }

  private String getDocumentContents(Document doc) throws RepositoryException, IOException {
    BinaryValue val = (BinaryValue) Value.getSingleValue(doc, SpiConstants.PROPNAME_CONTENT);
    InputStream in = val.getInputStream();
    byte[] buf = new byte[BUF_SIZE];
    int pos = 0;
    int len = in.read(buf, 0, BUF_SIZE);
    while (len != -1) {
      pos += len;
View Full Code Here


        }));
  }

  /** Tests BinaryValue constructors - InputStreamFactory. */
  public void testBinaryValueInputStreamFactoryError() throws Exception {
    BinaryValue value = (BinaryValue) Value.getBinaryValue(
        new InputStreamFactory() {
          public InputStream getInputStream() throws IOException {
            throw new IOException("Test Exception");
          }
        });

    try {
      value.getInputStream();
      fail("Expected RepositoryDocumentException, but got none.");
    } catch (RepositoryDocumentException expected) {
      // Expected.
    }
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spiimpl.BinaryValue

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.