Package com.google.enterprise.connector.spi

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


         Where.DOCUMENT_CONTENT, 0);
  }

  public void testRepositoryDocumentException() {
    checkExceptionHandling(
         new RepositoryDocumentException("RepositoryDocumentException"),
         Where.DOCUMENT_CONTENT, 2, 1);
  }
View Full Code Here


  public InputStream getInputStream() throws RepositoryDocumentException {
    if (factory != null) {
      try {
        return new EofFilterInputStream(factory.getInputStream());
      } catch (IOException e) {
        throw new RepositoryDocumentException("Failed to get InputStream", e);
      }
    } else {
      return binaryValue;
    }
  }
View Full Code Here

        if (documentContentEncoding == ContentEncoding.ERROR
            || supportedEncodings.indexOf(documentContentEncodingStr) < 0) {
          String message =
              "Unsupported content encoding: " + documentContentEncodingStr;
          LOGGER.log(Level.WARNING, message);
          throw new RepositoryDocumentException(message);
        }
      }
      alternateEncoding = (documentContentEncoding == null)
          ? contentEncoding : documentContentEncoding;
 
View Full Code Here

      throws RepositoryException {
    String result = null;
    result = getStringAndThrow(document, name);
    if (result == null) {
      LOGGER.log(Level.WARNING, "Document missing required property " + name);
      throw new RepositoryDocumentException(
          "Document missing required property " + name);
    }
    return result;
  }
View Full Code Here

    Property property = null;

    // we just do the DOCID first so it is easy to find
    String name = SpiConstants.PROPNAME_DOCID;
    if ((property = document.findProperty(name)) == null) {
      throw new RepositoryDocumentException(SpiConstants.PROPNAME_DOCID
                                            + " is missing");
    }
    processProperty(name, property);

    for (String propName : document.getPropertyNames()) {
View Full Code Here

          try {
            while (-1 != (bytesRead = encodedContentStream.read(b))) {
              totalBytesRead += bytesRead;
            }
          } catch (IOException e) {
            throw new RepositoryDocumentException(
                "Error reading content stream.", e);
          }
        }
        printStream.println("Total bytes read in base64 encoded file: "
            + totalBytesRead);
View Full Code Here

      throws RepositoryException, RepositoryDocumentException {
    String url = getOrConstructUrl(document, SpiConstants.PROPNAME_SEARCHURL,
         SpiConstants.PROPNAME_DOCID, SpiConstants.PROPNAME_FRAGMENT,
         defaultFeedType, documentType);
    if (url == null) {
      throw new RepositoryDocumentException(
          "Document has neither property " + SpiConstants.PROPNAME_DOCID
          + " nor property " + SpiConstants.PROPNAME_SEARCHURL);
    }
    return url;
  }
View Full Code Here

        new URL(null, url, SmbURLStreamHandler.getInstance());
      } else {
        new URL(url);
      }
    } catch (MalformedURLException e) {
      throw new RepositoryDocumentException(
          "Supplied " + description + " URL " + url + " is malformed.", e);
    }
  }
View Full Code Here

        }

        // It does not appear to be a transient failure.  Assume this
        // document contains permanent failures, and skip over it.
        docsProcessed++;
        throw new RepositoryDocumentException(t);
      }
    }

    // No more documents available.
    checkpoint.advanceToEnd();
View Full Code Here

   * Otherwise it does nothing.
   */
  private void throwFetchVersionException(int objectId)
      throws RepositoryException {
    if (objectId == MockConstants.DOCUMENT_OBJECT_ID) {
      throw new RepositoryDocumentException(new RuntimeException(
              "Simulated Premature end-of-data on socket"));
    } else if (objectId == MockConstants.IO_OBJECT_ID) {
      throw new LivelinkIOException(new RuntimeException(
              "Simulated Server did not accept open request"), LOGGER);
    } else if (objectId == MockConstants.REPOSITORY_OBJECT_ID) {
View Full Code Here

TOP

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

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.