- GitHub API helpers for reading remote repository contents
- URL parsing utilities for GitHub paths
- Optional GitHub token support via
tulip.properties - Simple integration with Maven
Include TULIP in your Java project using JitPack.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories><dependency>
<groupId>com.github.javiergs</groupId>
<artifactId>TULIP</artifactId>
<version>v3.0</version>
</dependency>-
URLFactory
Parses GitHub URLs (root, tree, blob) and normalizes missing parts (e.g., default branch =main) -
URLObject
Represents a structured GitHub resource with:- owner
- repository
- revision (branch/tag/commit)
- path
- kind (
ROOT,TREE,BLOB) - convenience helpers
isBlob(),isDirectory()
GitHubHandler
- List files and folders in any repo
- Fetch file contents
- Recursive traversal of remote repositories
- Automatic fallback to
mainbranch - Supports authentication via a local properties file
Create a file:
src/main/resources/tulip.properties
Add:
GITHUB_TOKEN=ghp_your_token_here
This avoids API rate limits for unauthenticated users.
URLObject u = URLFactory.parseGitHubUrl(
"https://github.com/javiergs/ADASIM/tree/main/src"
);GitHubHandler gh = new GitHubHandler();
List<String> files = gh.listFiles("https://github.com/javiergs/ADASIM");String text = gh.getFileContentFromUrl(
"https://github.com/javiergs/ADASIM/blob/main/pom.xml"
);Full JavaDoc available at: