Examples of ContentStream


Examples of org.apache.chemistry.opencmis.commons.data.ContentStream

            throws Exception {
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PropertyIds.NAME, name);
        properties.put(PropertyIds.OBJECT_TYPE_ID, type);

        ContentStream content = createContentStream(filename);
        clientSession.getSession()
                .createDocument(properties, currentFolder, content, versioningState, null, null, null);
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ContentStream

                    addACEs, removeACEs, extension);
            if (null == id) {
                fail("createDocument failed.");
            }

            ContentStream sd = fObjSvc.getContentStream(fRepositoryId, id, null, BigInteger.valueOf(-1) /* offset */,
                    BigInteger.valueOf(-1) /* length */, null);
            assertNotNull(sd.getMimeType());
            assertNotNull(sd.getFileName());
        } catch (Exception e) {
            fail("createDocument() failed with exception: " + e);
        }
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ContentStream

        } catch (Exception e) {
            fail("createDocumentFromSource() failed with exception: " + e);
        }

        // get content from second document and compare it with original one
        ContentStream sd = fObjSvc.getContentStream(fRepositoryId, id2, null, BigInteger.valueOf(-1) /* offset */,
                BigInteger.valueOf(-1) /* length */, null);
        verifyContentResult(sd);

        // cleanup
        fObjSvc.deleteObject(fRepositoryId, id1, true, null);
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ContentStream

            assertEquals(typeId, pd.getFirstValue());
        }
    }

    private String createDocumentWithCustomType(String folderId, boolean withContent) {
        ContentStream contentStream = null;
        VersioningState versioningState = VersioningState.NONE;
        List<String> policies = null;
        Acl addACEs = null;
        Acl removeACEs = null;
        ExtensionsData extension = null;
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ContentStream

        }
        return id;
    }

    private String createDocumentInheritedProperties(String folderId, boolean withContent) {
        ContentStream contentStream = null;
        VersioningState versioningState = VersioningState.NONE;
        List<String> policies = null;
        Acl addACEs = null;
        Acl removeACEs = null;
        ExtensionsData extension = null;
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ContentStream

            log.debug("createDocument with exceeded failed with wrong exception (expected CmisInvalidArgumentException, got "
                    + e1.getClass().getName() + ").");
        }

        try {
            ContentStream contentStream = createContent(MAX_SIZE + 1);
            Properties props = createDocumentProperties("TestMaxContentSize", DOCUMENT_TYPE_ID);
            fObjSvc.createDocument(fRepositoryId, props, fRootFolderId, contentStream, VersioningState.NONE, null,
                    null, null, null);
            fail("createDocument with exceeded content size should fail.");
        } catch (CmisInvalidArgumentException e) {
View Full Code Here

Examples of org.apache.solr.common.util.ContentStream

  public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException
  {
    Object obj = response.getValues().get( CONTENT );
    if( obj != null && (obj instanceof ContentStream ) ) {
      // copy the contents to the writer...
      ContentStream content = (ContentStream)obj;
      Reader reader = content.getReader();
      try {
        IOUtils.copy( reader, writer );
      } finally {
        reader.close();
      }
View Full Code Here

Examples of org.apache.solr.common.util.ContentStream

public void write(OutputStream out, SolrQueryRequest request,
    SolrQueryResponse response) throws IOException {
    Object obj = response.getValues().get( CONTENT );
    if( obj != null && (obj instanceof ContentStream ) ) {
      // copy the contents to the writer...
      ContentStream content = (ContentStream)obj;
      java.io.InputStream in = content.getStream();
      try {
        IOUtils.copy( in, out );
      } finally {
        in.close();
      }
View Full Code Here

Examples of org.apache.solr.common.util.ContentStream

    request.setQuery(query);

    boolean showMatch = params.getBool(AnalysisParams.SHOW_MATCH, false);
    request.setShowMatch(showMatch);

    ContentStream stream = extractSingleContentStream(req);
    InputStream is = null;
    XMLStreamReader parser = null;
   
    try {
      is = stream.getStream();
      final String charset = ContentStreamBase.getCharsetFromContentType(stream.getContentType());
      parser = (charset == null) ?
        inputFactory.createXMLStreamReader(is) : inputFactory.createXMLStreamReader(is, charset);

      while (true) {
        int event = parser.next();
View Full Code Here

Examples of org.apache.solr.common.util.ContentStream

    Iterator<ContentStream> iter = streams.iterator();
    if (!iter.hasNext()) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
              "DocumentAnlysisRequestHandler expects a single content stream with documents to analyze");
    }
    ContentStream stream = iter.next();
    if (iter.hasNext()) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
              "DocumentAnlysisRequestHandler expects a single content stream with documents to analyze");
    }
    return stream;
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.