Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ObjectLoader.copyTo()


    otp.setOffset(out.length());
    out.writeHeader(otp, ldr.getSize());

    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    ldr.copyTo(dst);
    dst.finish();
  }

  private void writeDeltaObjectDeflate(PackOutputStream out,
      final ObjectToPack otp) throws IOException {
View Full Code Here


    if (opt.getAutoCRLF() == AutoCRLF.TRUE)
      channel = new AutoCRLFOutputStream(rawChannel);
    else
      channel = rawChannel;
    try {
      ol.copyTo(channel);
    } finally {
      channel.close();
    }
    FS fs = repo.getFS();
    if (opt.isFileMode() && fs.supportsExecute()) {
View Full Code Here

    otp.setOffset(out.length());
    out.writeHeader(otp, ldr.getSize());

    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    ldr.copyTo(dst);
    dst.finish();
  }

  private void writeDeltaObjectDeflate(PackOutputStream out,
      final ObjectToPack otp) throws IOException {
View Full Code Here

        for (Note note : call) {
            System.out.println("Note: " + note + " " + note.getName() + " " + note.getData().getName() + "\nContent: ");

            // displaying the contents of the note is done via a simple blob-read
            ObjectLoader loader = repository.open(note.getData());
            loader.copyTo(System.out);
        }

        repository.close();
    }
}
View Full Code Here

        System.out.println("Tag: " + any);

        // finally try to print out the tag-content
        System.out.println("\nTag-Content: \n");
        ObjectLoader loader = repository.open(annotatedTag.getObjectId());
        loader.copyTo(System.out);

        walk.dispose();

        repository.close();
    }
View Full Code Here

        Ref head = repository.getRef("refs/heads/master");
        System.out.println("Ref of refs/heads/master: " + head);

        System.out.println("\nPrint contents of head of master branch, i.e. the latest commit information");
        ObjectLoader loader = repository.open(head.getObjectId());
        loader.copyTo(System.out);

        System.out.println("\nPrint contents of tree of head of master branch, i.e. the latest binary tree information");

        // a commit points to a tree
        RevWalk walk = new RevWalk(repository);
View Full Code Here

        RevWalk walk = new RevWalk(repository);
        RevCommit commit = walk.parseCommit(head.getObjectId());
        RevTree tree = walk.parseTree(commit.getTree().getId());
        System.out.println("Found Tree: " + tree);
        loader = repository.open(tree.getId());
        loader.copyTo(System.out);

        walk.dispose();

        repository.close();
    }
View Full Code Here

      }
      System.out.println("Found note: " + note + " for commit " + head);

      // displaying the contents of the note is done via a simple blob-read
      ObjectLoader loader = repository.open(note.getData());
      loader.copyTo(System.out);
    }

        walk.dispose();

    repository.close();
View Full Code Here

        ObjectId objectId = treeWalk.getObjectId(0);
        ObjectLoader loader = repository.open(objectId);

        // and then one can the loader to read the file
        loader.copyTo(System.out);

        revWalk.dispose();

        repository.close();
    }
View Full Code Here

        ObjectId objectId = treeWalk.getObjectId(0);
        ObjectLoader loader = repository.open(objectId);

        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        // and then one can the loader to read the file
        loader.copyTo(stream);

        revWalk.dispose();

        return IOUtils.readLines(new ByteArrayInputStream(stream.toByteArray())).size();
    }
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.