All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kgrid.shelf.repository.ZipService Maven / Gradle / Ivy

package org.kgrid.shelf.repository;

import com.fasterxml.jackson.databind.JsonNode;
import java.util.ArrayList;
import java.util.List;
import org.kgrid.shelf.domain.KnowledgeObject;

public abstract class ZipService {

  /**
   * Get a list of implementation paths, service, deployment and payload
   *
   * @param implementationNode ko implementation jsonnode
   * @return list of paths to implementation binaries
   */
  protected List listBinaryNodes(JsonNode implementationNode) {

    List binaryNodes = new ArrayList<>();
    if (implementationNode.has(KnowledgeObject.DEPLOYMENT_SPEC_TERM)) {
      binaryNodes.add(implementationNode.findValue(KnowledgeObject.DEPLOYMENT_SPEC_TERM).asText());
    }
    if (implementationNode.has(KnowledgeObject.PAYLOAD_TERM)) {
      binaryNodes.add(implementationNode.findValue(KnowledgeObject.PAYLOAD_TERM).asText());
    }
    if (implementationNode.has(KnowledgeObject.SERVICE_SPEC_TERM)) {
      binaryNodes.add(implementationNode.findValue(KnowledgeObject.SERVICE_SPEC_TERM).asText());
    }

    return binaryNodes;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy