Lightweight utility library for Java projects
Part of the TANK Series.
- File utilities (copy, move, traversal, path helpers)
- Binary utilities (bit manipulation)
- String utilities
- ANSI color constants
- Data and time unit constants
- Lightweight with no external dependencies
- Clean API
- Minimal
- Lightweight
Currently, Toolbox is not on Maven Central. To use it, clone the repository and publish it to your local Maven Repository.
git clone https://github.com/breadcat-dev/toolbox.git
cd toolbox./gradlew publishToMavenLocal./gradlew.bat publishToMavenLocalOnce installed, add the dependency:
implementation "cat.breadcat:toolbox:<version>"implementation("cat.breadcat:toolbox:<version>")System.out.println(AnsiUtil.RED + "This text is red." + AnsiUtil.RESET);long byteTest = 0; // 00000000 00000000 00000000 00000000
byteTest = BinaryUtil.setBit(byteTest, 2); // 00000000 00000000 00000000 00000100Path useful = Path.of("./input.bin");
Path backupUseful = Path.of("./backup/input.bin");
try
{
FileIOUtil.copy(useful, backupUseful);
}
catch(IOException e)
{
throw new RuntimeException(e);
}Path chosenDirectory = Path.of("./project");
List<Path> filesInDirectory = new ArrayList<>();
try
{
filesInDirectory = FileQueryUtil.files(chosenDirectory);
}
catch(IOException e)
{
throw new RuntimeException(e);
}( File structure )
project/
├── test.txt
├── main.c
└── assets/
├── icon.png
└── breadcat.png
( filesInDirectory )
./project/test.txt
./project/main.c
./project/assets/icon.png
./project/assets/breadcat.png
Path file = Path.of("./Main.java");
String extension = PathUtil.extension(file);( extension )
String extension = "java";String text = StringUtil.join(", ", "breadcat", 43, true);
System.out.println(text);breadcat, 43, true
System.out.println("There are " + BinaryDataUnits.MiB + " bytes in a MiB.");There are 1048576 bytes in a MiB.
This library has no external dependencies.