Class Checkout

java.lang.Object
org.eclipse.jgit.dircache.Checkout

public class Checkout extends Object
An object that can be used to check out many files.
Since:
6.6.1
  • Field Details

  • Constructor Details

  • Method Details

    • getWorkingTreeOptions

      public WorkingTreeOptions getWorkingTreeOptions()
      Retrieves the WorkingTreeOptions of the repository that are used.
      Returns:
      the WorkingTreeOptions
    • setRecursiveDeletion

      public Checkout setRecursiveDeletion(boolean recursive)
      Defines whether directories that are in the way of the file to be checked out shall be deleted recursively.
      Parameters:
      recursive - whether to delete such directories recursively
      Returns:
      this
    • safeCreateParentDirectory

      public void safeCreateParentDirectory(String gitPath, File parentDir, boolean makeSpace) throws IOException
      Ensure that the given parent directory exists, and cache the information that gitPath refers to a file.
      Parameters:
      gitPath - of the file to be written
      parentDir - directory in which the file shall be placed, assumed to be the parent of the gitPath
      makeSpace - whether to delete a possibly existing file at parentDir
      Throws:
      IOException - if the directory cannot be created, if necessary
    • checkoutGitlink

      public void checkoutGitlink(DirCacheEntry entry, String gitPath) throws IOException
      Checks out the gitlink given by the DirCacheEntry.
      Parameters:
      entry - DirCacheEntry to check out
      gitPath - the git path of the entry, if known already; otherwise null and it's read from the entry itself
      Throws:
      IOException - if the gitlink cannot be checked out
    • checkout

      public void checkout(DirCacheEntry entry, DirCacheCheckout.CheckoutMetadata metadata, ObjectReader reader, String gitPath) throws IOException
      Checks out the file given by the DirCacheEntry.
      Parameters:
      entry - DirCacheEntry to check out
      metadata - DirCacheCheckout.CheckoutMetadata to use for CR/LF handling and smudge filtering
      reader - ObjectReader to use
      gitPath - the git path of the entry, if known already; otherwise null and it's read from the entry itself
      Throws:
      IOException - if the file cannot be checked out