Package com.google.enterprise.connector.spi

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


    if (e instanceof LLIOException) {
      // XXX: Hideous hack, but the LAPI error strings are hard-coded
      // and in English, and I cannot think of another way to
      // distinguish this error, which we must distinguish.
      if ("Premature end-of-data on socket".equals(e.getMessage())) {
        return new RepositoryDocumentException(e);
      } else {
        return new LivelinkIOException(e, LOGGER);
      }
    } else if (e instanceof LLBadServerCertificateException
        || e instanceof LLCouldNotConnectException
View Full Code Here


              };
          }
      } catch (Throwable t) {
        String msg = new StringBuffer("Unable to fetch contents from URL: ").append(url).toString();
        LOGGER.log(Level.WARNING, "Unable to fetch contents from URL: " + url, t);
        throw new RepositoryDocumentException(msg, t);
      }
      // checks if the give URL is for .msg file if true set the mimetype
      // directly to application/vnd.ms-outlook as mimetype returned by the
      // header is incorrect for .msg files
      if (!contentDwnldURL.endsWith(MSG_FILE_EXTENSION)) {
View Full Code Here

  public boolean isModifiedSince(long time) throws RepositoryException {
    try {
      long lastModified = getLastModified();
      return (lastModified > 0) ? (lastModified >= time) : true;
    } catch (IOException e) {
      throw new RepositoryDocumentException(
          "Failed to get last modified time for " + getPath(), e);
    }
  }
View Full Code Here

  /**
   * Test a file that throws RepositoryDocumentException is not authorized,
   * but the rest are.
   */
  public void testRepositoryDocumentException() throws Exception {
    testException(new RepositoryDocumentException("Test Exception"));
  }
View Full Code Here

  }

  public void testDocumentAcceptorRepositoryDocumentException()
      throws Exception {
    testDocumentAcceptorException(
        new RepositoryDocumentException("Test Exception"));
  }
View Full Code Here

    assertEquals(testFileName, ((FileDocument) document).getDocumentId());
  }

  public void testGetMetaDataRepositoryDocumentException() throws Exception {
    testFile.setException(MockReadonlyFile.Where.ALL,
                          new RepositoryDocumentException("Test Exception"));
    try {
      Document document = retriever.getMetaData(testFileName);
      document.findProperty(SpiConstants.PROPNAME_LASTMODIFIED);
      fail("Expected RepositoryDocumentException, but got none.");
    } catch (RepositoryDocumentException expected) {
View Full Code Here

    MockReadonlyFile result = root;
    for (String name : names) {
      if (name.length() != 0) {
        if (result.get(name) == null) {
          throw new RepositoryDocumentException("No such file or directory: "
              + result.getPath() + "/" + name);
        }
        result = result.get(name);
      }
    }
View Full Code Here

          return SecureDocument.createAcl(aclValues);
        } else {
          return null;
        }
      } catch (IOException e) {
        throw new RepositoryDocumentException("Failed to create share ACL for "
            + root.getPath(), e);
      }
    }
View Full Code Here

        FileDocument fileAcl = new FileDocument(file, context, root,
            FILE_INHERIT_ACL_PREFIX + file.getPath(),
            file.getFileInheritAcl());
        return ImmutableList.<FileDocument>of(containerAcl, fileAcl);
      } catch (IOException e) {
        throw new RepositoryDocumentException("Failed to get inheritable ACLs",
                                              e);
      }
    } else {
      // Return a single Document representing the file.
      return ImmutableList.<FileDocument>of(
View Full Code Here

    // Retriever might not fetch content in the case of IfModifiedSince.
    if (SpiConstants.PROPNAME_CONTENT.equals(name)) {
      try {
        return new SimpleProperty(Value.getBinaryValue(file.getInputStream()));
      } catch (IOException e) {
        throw new RepositoryDocumentException(
            "Failed to open " + file.getPath(), e);
      }
    } else if (SpiConstants.PROPNAME_MIMETYPE.equals(name) &&
               properties.get(name) == null) {
      fetchMimeType(file);
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.