{"id":17932336,"url":"https://github.com/kjarosh/jfm","last_synced_at":"2025-10-03T17:08:16.446Z","repository":{"id":43326608,"uuid":"177867243","full_name":"kjarosh/jfm","owner":"kjarosh","description":"Java Filesystem Mapper","archived":false,"fork":false,"pushed_at":"2023-06-19T16:56:54.000Z","size":251,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T10:43:44.534Z","etag":null,"topics":["filesystem","fuse","java","object-mapping"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kjarosh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2019-03-26T20:55:14.000Z","updated_at":"2022-07-06T16:18:34.000Z","dependencies_parsed_at":"2025-04-03T10:40:52.047Z","dependency_job_id":"febb82e7-80e3-42c1-b1b9-714f69edba4e","html_url":"https://github.com/kjarosh/jfm","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kjarosh/jfm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjarosh%2Fjfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjarosh%2Fjfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjarosh%2Fjfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjarosh%2Fjfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kjarosh","download_url":"https://codeload.github.com/kjarosh/jfm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjarosh%2Fjfm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278196448,"owners_count":25946326,"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-10-03T02:00:06.070Z","response_time":53,"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":["filesystem","fuse","java","object-mapping"],"created_at":"2024-10-28T21:26:26.830Z","updated_at":"2025-10-03T17:08:16.441Z","avatar_url":"https://github.com/kjarosh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Filesystem Mapper\n\n[![Build Status](https://github.com/kjarosh/jfm/actions/workflows/maven.yml/badge.svg)](https://github.com/kjarosh/jfm/actions/workflows/maven.yml)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/73a0054f65344a96867c51361c9486c8)](https://www.codacy.com/app/kjarosh/jfm?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=kjarosh/jfm\u0026amp;utm_campaign=Badge_Grade)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6585b2f62e6e75643704/maintainability)](https://codeclimate.com/github/kjarosh/jfm/maintainability)\n[![Release](https://jitpack.io/v/kjarosh/jfm.svg)](https://jitpack.io/#kjarosh/jfm)\n\n## What is it?\n\nThis is a library used to map filesystem resources to Java objects and vice-versa.\n\n## Features\n\n- mapping filesystem resources to Java objects,\n- mapping Java objects to filesystem resources,\n- registering custom type handlers.\n\n## Example\n\nInterface:\n\n```java\n@FilesystemResource\ninterface PersonInfo {\n    @Read\n    @Path(\"first-name\")\n    String getFirstName();\n\n    @Read\n    @Path(\"last-name\")\n    String getLastName();\n}\n```\n\n### Filesystem to Java mapping\n\nFilesystem:\n\n```text\npersons\n|- person1\n|  |- first-name\n|  \\- last-name\n\\- person2\n   |- first-name\n   \\- last-name\n```\n\nThe following code maps the above filesystem into instances of `PersonInfo`.\n\n```java\nPath root = Paths.get(\"persons\");\nFilesystemMapper fsmapper = FilesystemMapper.instance();\n\nFilesystemMapperTarget person1Target = fsmapper.getTarget(root.resolve(\"person1\"));\nFilesystemMapperTarget person2Target = fsmapper.getTarget(root.resolve(\"person2\"));\n\nPersonInfo person1 = person1Target.proxy(PersonInfo.class);\nPersonInfo person2 = person2Target.proxy(PersonInfo.class);\n\n// print contents of persons/person1/first-name\nSystem.out.println(person1.getFirstName());\n// print contents of persons/person1/last-name\nSystem.out.println(person1.getLastName());\n\n// print contents of persons/person2/first-name\nSystem.out.println(person2.getFirstName());\n// print contents of persons/person2/last-name\nSystem.out.println(person2.getLastName());\n``` \n\n## Java to filesystem mapping\n\nImplementation:\n\n```java\nclass PersonInfoImpl implements PersonInfo {\n    public String getFirstName() {\n        return \"John\";\n    }\n\n    public String getLastName() {\n        return \"Smith\";\n    }\n}\n```\n\nThe following code maps the above implementation into the filesystem.\n\n```java\nPath root = Paths.get(\"person\");\nFilesystemMapper fsmapper = FilesystemMapper.instance();\n\nFilesystemMapperTarget personTarget = fsmapper.getTarget(root);\n\nPersonInfo person = new PersonInfoImpl();\npersonTarget.mount(person);\n``` \n\nThe resulting filesystem:\n\n```text\nperson\n|- first-name\n\\- last-name\n```\n\nThe contents of `person/first-name` and `person/last-name` should be `John`\nand `Smith` respectively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjarosh%2Fjfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjarosh%2Fjfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjarosh%2Fjfm/lists"}