{"id":30420413,"url":"https://github.com/generaloss/resource-flow","last_synced_at":"2026-01-06T23:18:33.810Z","repository":{"id":308939834,"uuid":"1034592197","full_name":"generaloss/resource-flow","owner":"generaloss","description":"Resources Library","archived":false,"fork":false,"pushed_at":"2025-08-08T18:43:12.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-08T20:45:07.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generaloss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T16:35:38.000Z","updated_at":"2025-08-08T18:43:15.000Z","dependencies_parsed_at":"2025-08-08T22:15:12.159Z","dependency_job_id":null,"html_url":"https://github.com/generaloss/resource-flow","commit_stats":null,"previous_names":["generaloss/resource-flow"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/generaloss/resource-flow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generaloss%2Fresource-flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generaloss%2Fresource-flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generaloss%2Fresource-flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generaloss%2Fresource-flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generaloss","download_url":"https://codeload.github.com/generaloss/resource-flow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generaloss%2Fresource-flow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271606604,"owners_count":24788981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-22T08:19:07.338Z","updated_at":"2026-01-06T23:18:33.804Z","avatar_url":"https://github.com/generaloss.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Resource-Flow](https://github.com/generaloss/resource-flow)\r\n\r\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.generaloss/resource-flow.svg)](https://mvnrepository.com/artifact/io.github.generaloss/resource-flow)\r\n\r\nA lightweight and unified resource access library for Java applications. Provides consistent APIs for working with files, classpath resources, URLs, ZIP archives, and more.\r\n\r\n## Features\r\n\r\n* Unified resource abstraction - single API for multiple resource types\r\n* Resource sources:\r\n  * File system resources\r\n  * Classpath/internal resources\r\n  * URL resources\r\n  * ZIP/JAR archive entries\r\n  * Temporary files\r\n* Streaming utilities - Binary and text streaming with convenience methods\r\n* Resource management - Handle-based resource lifecycle management\r\n* Flexible I/O - Support for various data types and formats\r\n\r\n---\r\n\r\n## Installation\r\n\r\nAdd the dependency from Maven Central:\r\n\r\n``` xml\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003eio.github.generaloss\u003c/groupId\u003e\r\n    \u003cartifactId\u003eresource-flow\u003c/artifactId\u003e\r\n    \u003cversion\u003e26.1.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nRequirements:\r\n* Java 11 or higher\r\n* External dependencies are **optional** (spatial-math, raw-list)\r\n\r\n---\r\n\r\n## Examples\r\n\r\n### Basic Usage\r\n\r\n``` java\r\n// Different resource types\r\nResource fileRes = Resource.file(\"config/settings.json\");\r\nResource internalRes = Resource.internal(\"defaults.properties\");\r\nResource urlRes = Resource.url(\"https://example.com/data.txt\");\r\n\r\n// Read content\r\nString content = fileRes.readString();\r\nbyte[] data = classpathRes.readBytes();\r\nString[] lines = urlRes.readLines();\r\n```\r\n\r\n### Working with Files\r\n\r\n``` java\r\n// File operations\r\nFileResource config = Resource.file(\"app/config.yaml\");\r\nconfig.createWithParents(); // Create file and parent directories\r\n\r\n// Write data\r\nconfig.writeString(\"key: value\");\r\nconfig.appendString(\"\\nnew: data\");\r\n\r\n// List 'app/' directory contents\r\nFileResource[] files = config.parent().listResources();\r\n```\r\n\r\n### FastReader\r\n\r\n``` java\r\nFastReader reader = resource.reader();\r\nwhile (reader.hasNext()) {\r\n    String line = reader.nextLine();\r\n    int number = reader.nextInt();\r\n    String word = reader.nextWord();\r\n}\r\n```\r\n\r\n### Binary streams reading/writing\r\n\r\n``` java\r\nBinaryInputStream binInput = resource.inStreamBin();\r\n// Read complex data structures\r\nString name = binInput.readUTFString();\r\nint[] ids = binInput.readIntArray();\r\nUUID entityId = binInput.readUUID();\r\n// (If has installed spatial-math library)\r\nVec3f position = binInput.readVec3f();\r\nQuaternion rotation = binInput.readQuaternion();\r\n\r\nBinaryOutputStream binOutput = fileRes.outStreamBin();\r\n// Write in the same way\r\nbinOutput.writeInt(42);\r\nbinOutput.writeFloatArray(1.0f, 2.0f, 3.0f);\r\n```\r\n\r\n### Advanced Resource Types\r\n\r\n``` java\r\n// ZIP archive resources\r\nZipFile zip = new ZipFile(\"archive.zip\");\r\nZipResource[] entries = Resource.zip(zip);\r\n\r\n// Classpath resource scanning\r\nClasspathResource pkg = Resource.classpath(\"com/example/models\");\r\nClass\u003c?\u003e[] classes = pkg.listClassesRecursive();\r\n\r\n// Temporary files\r\nTempFileResource temp = Resource.temp(\"prefix-\", \".tmp\");\r\ntemp.writeBytes(data);\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneraloss%2Fresource-flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneraloss%2Fresource-flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneraloss%2Fresource-flow/lists"}