Class URLObject

java.lang.Object
javiergs.tulip.URLObject

public class URLObject extends Object
Represents a GitHub URL object with an owner, repository, revision, path, and kind.
Version:
3.0
Author:
javiergs
  • Field Details

  • Constructor Details

    • URLObject

      public URLObject(String owner, String repository, String revision, String path, URLObject.Kind kind)
      Constructs a URLObject with the specified parameters.
      Parameters:
      owner - the owner of the repository
      repository - the name of the repository
      revision - the revision (branch, tag, or commit) can be null
      path - the path within the repository can be null or empty for root
      kind - the kind of the URL object (ROOT, TREE, BLOB)
      Throws:
      IllegalArgumentException - if the owner or repository is null or blank
  • Method Details

    • isBlob

      public boolean isBlob()
      Checks if the URL object represents a blob (file).
      Returns:
      true if the kind is BLOB, false otherwise
    • isDirectory

      public boolean isDirectory()
      Checks if the URL object represents a directory (tree or root).
      Returns:
      true if the kind is TREE or ROOT, false otherwise
    • toString

      public String toString()
      Returns a readable string representation of this URLObject, including an owner, repository, revision, path, and kind.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the URLObject