Package org.servalproject.servaldna

Examples of org.servalproject.servaldna.ServalDClient


    System.exit(0);
  }

  static void rhizome_payload_raw(BundleId bid, String dstpath) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    FileOutputStream out = null;
    try {
      RhizomePayloadRawBundle bundle = client.rhizomePayloadRaw(bid);
      if (bundle == null)
        System.out.println("not found");
      else {
        InputStream in = bundle.rawPayloadInputStream;
        if (in == null)
View Full Code Here


    System.exit(0);
  }

  static void rhizome_payload_decrypted(BundleId bid, String dstpath) throws ServalDInterfaceException, IOException, InterruptedException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    FileOutputStream out = null;
    try {
      RhizomePayloadBundle bundle = client.rhizomePayload(bid);
      if (bundle == null)
        System.out.println("not found");
      else {
        InputStream in = bundle.payloadInputStream;
        if (in == null)
View Full Code Here

    throws   ServalDInterfaceException,
        IOException,
        InterruptedException,
        SubscriberId.InvalidHexException
  {
    ServalDClient client = new ServerControl().getRestfulClient();
    try {
      RhizomeIncompleteManifest manifest = new RhizomeIncompleteManifest();
      if (manifestPath != null && manifestPath.length() != 0)
        manifest.parseTextFormat(new FileInputStream(manifestPath));
      RhizomeInsertBundle bundle;
      SubscriberId authorSid = author == null || author.length() == 0 ? null : new SubscriberId(author);
      BundleSecret secret = secretHex == null || secretHex.length() == 0 ? null : new BundleSecret(secretHex);
      if (payloadName == null || payloadName.length() == 0)
        payloadName = new File(payloadPath).getName();
      if (payloadPath == null || payloadPath.length() == 0)
        bundle = client.rhizomeInsert(authorSid, manifest, secret);
      else
        bundle = client.rhizomeInsert(authorSid, manifest, secret, new FileInputStream(payloadPath), payloadName);
      System.out.println(
          "_status=" + bundle.status + "\n" +
          (bundle.rowId == null ? "" : "_rowId=" + bundle.rowId + "\n") +
          (bundle.insertTime == null ? "" : "_insertTime=" + bundle.insertTime + "\n") +
          (bundle.author == null ? "" : "_author=" + bundle.author + "\n") +
View Full Code Here

TOP

Related Classes of org.servalproject.servaldna.ServalDClient

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.