Codota Logo
DatabaseDocument
Code IndexAdd Codota to your IDE (free)

How to use
DatabaseDocument
in
com.marklogic.mapreduce

Best Java code snippets using com.marklogic.mapreduce.DatabaseDocument (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: com.marklogic/marklogic-mapreduce2

@Override
public InputStream getContentAsByteStream() {
  if (is != null) {
    return is;
  }
  return new ByteArrayInputStream(getContentAsByteArray());
}

origin: com.marklogic/marklogic-mapreduce2

public MarkLogicNode getContentAsMarkLogicNode() {
  if (contentType == ContentType.XML || 
    contentType == ContentType.TEXT) {
    return new MarkLogicNode(getContentAsText().toString(), 
            contentType);      
  }
  throw new UnsupportedOperationException(
    "Cannot convert JSON or binary data to MarkLogicNode.");        
}

origin: com.marklogic/mlcp

private void readDocFromStream(long entryLength, DatabaseDocument doc)
  throws IOException {
  ByteArrayOutputStream baos;
  if (entryLength == -1) {
    baos = new ByteArrayOutputStream();
  } else {
    baos = new ByteArrayOutputStream((int) entryLength);
  }
  int size;
  while ((size = zipIn.read(buf, 0, buf.length)) != -1) {
    baos.write(buf, 0, size);
  }
  doc.setContentType(type);
  doc.setContent(baos.toByteArray());
  baos.close();
}
origin: com.marklogic/marklogic-mapreduce2

DatabaseDocument doc = (DatabaseDocument)value;
if (formatNeeded) {
  options.setFormat(doc.getContentType().getDocumentFormat());
  formatNeeded = false;
if (doc.getContentType() == ContentType.BINARY) {
  content = ContentFactory.newContent(uri, 
      doc.getContentAsByteArray(), options);
} else {
  content = ContentFactory.newContent(uri, 
      doc.getContentAsText().getBytes(), options);
origin: com.marklogic/marklogic-mapreduce2

  ((MarkLogicNode)value).set(result);
} else if (valueClass.equals(DatabaseDocument.class)) {
  ((DatabaseDocument) value).set(result);
} else {
  throw new UnsupportedOperationException("Value " +  
com.marklogic.mapreduceDatabaseDocument

Javadoc

A MarkLogicDocument retrieved from a database via MarkLogic Server.

Most used methods

  • getContentAsByteArray
  • getContentAsText
  • getContentType
  • set
  • setContent
  • setContentType

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Collectors (java.util.stream)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now