{"id":45589405,"url":"https://github.com/abarhub/filerw","last_synced_at":"2026-02-23T12:01:33.061Z","repository":{"id":4008918,"uuid":"5107331","full_name":"abarhub/filerw","owner":"abarhub","description":"File read write","archived":false,"fork":false,"pushed_at":"2021-06-06T09:45:49.000Z","size":414,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-06-30T10:47:08.439Z","etag":null,"topics":["file","fixed-width","fixedlength","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abarhub.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-19T08:28:34.000Z","updated_at":"2021-08-16T10:22:02.000Z","dependencies_parsed_at":"2022-09-02T23:30:45.845Z","dependency_job_id":null,"html_url":"https://github.com/abarhub/filerw","commit_stats":null,"previous_names":[],"tags_count":7,"template":null,"template_full_name":null,"purl":"pkg:github/abarhub/filerw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarhub%2Ffilerw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarhub%2Ffilerw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarhub%2Ffilerw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarhub%2Ffilerw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abarhub","download_url":"https://codeload.github.com/abarhub/filerw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarhub%2Ffilerw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29742149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["file","fixed-width","fixedlength","java"],"created_at":"2026-02-23T12:01:31.531Z","updated_at":"2026-02-23T12:01:33.048Z","avatar_url":"https://github.com/abarhub.png","language":"Java","readme":"Filerw\n======\n\n[![Latest release](https://img.shields.io/github/release/abarhub/filerw.svg)](https://github.com/abarhub/filerw/releases/latest)\n[![Build Status](https://travis-ci.com/abarhub/filerw.svg?branch=master)](https://travis-ci.com/abarhub/filerw)\n[![Codecov](https://codecov.io/gh/abarhub/filerw/branch/master/graph/badge.svg)](https://codecov.io/gh/abarhub/filerw)\n![Build workflow](https://github.com/abarhub/filerw/actions/workflows/maven.yml/badge.svg)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.abarhub.filerw/filerw/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.abarhub.filerw/filerw)\n[![javadoc](https://javadoc.io/badge2/com.github.abarhub.filerw/filerw/javadoc.svg)](https://javadoc.io/doc/com.github.abarhub.filerw/filerw)\n\nFile read write with enum class  \n\nDépendance Maven\n----------------\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.abarhub.filerw\u003c/groupId\u003e\n  \u003cartifactId\u003efilerw\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nJavadoc\n-------\n\n[Javadoc version 1.0.0](https://abarhub.github.io/filerw/documentation/version_1.0.0/apidocs)\n\n[Javadoc version 0.2.0](https://abarhub.github.io/filerw/documentation/version_0.2.0/apidocs)\n\n[Javadoc version 0.1.0](https://abarhub.github.io/filerw/documentation/version_0.1.0/apidocs)\n\n[Javadoc version 0.27](https://abarhub.github.io/filerw/documentation/version_0.27/apidocs)\n\nExplication\n-----------\n\n[Documentation](https://abarhub.github.io/filerw/)\n\nversion 0.1.0 : compatible avec java 8\n\nPour l'utiliser avec une version inferieur à java 5, il faut utiliser une version inférieure à la version 0.1.0.\n\n\nExemple d'utilisation\n---------------------\n\nPour un fichier avec le format suivant :\n\n| Nom du champs | position sur une ligne | taille de la ligne |\n| ------------- |--------------:| -----:|\n| nom     | 0 | 30 |\n| prenom  | 30 | 30 |\n| date de naissance | 60 | 8 |\n\n\nLe séparateur est le retour à la ligne.\n\nExemple de fichier:\n\n```\nNewton                        Isaac                         04011643\nEinstein                      Albert                        14103879\nCopernic                      Nicolas                       19021473\n```\n\nVoici la classe pour définir le format du fichier :\n```java\npublic enum FormatPersonnes implements Field {\n\tNom(0, 30), Prenom(30, 30), DateNaissance(60, 8);\n\n\tprivate FieldsListChamps(int position, int length) {\n\t\tthis.position = position;\n\t\tthis.length = length;\n\t}\n\n\tpublic int getLength() {\n\t\treturn length;\n\t}\n\n\tpublic int getPosition() {\n\t\treturn position;\n\t}\n\n\tprivate int position;\n\tprivate int length;\n}\n```\n\nVoici la classe pour lire et écrire ce fichier :\n```java\npublic class LectureEcriturePersonnes{\n\n\tpublic void lecture(File f,File f_out) throws URISyntaxException, FileNotFoundException,\n\t\t\tIOException, ParseException {\n\t\tReadWriteText\u003cFieldsListChamps1\u003e lecture;\n\t\tFileContentText\u003cFieldsListChamps1\u003e fichier;\n\t\t\n\t\t// lecture du fichier f\n\t\tSystem.out.println(\"Lecture du fichier \" + f.getPath() + \" :\");\n\t\tlecture = new ReadWriteText\u003cFieldsListChamps1\u003e(f,FormatPersonnes.class);\n\t\tfichier = lecture.readFile();\n\t\t\n\t\t// affichage du contenu du fichier\n\t\tfichier.show();\n\t\t\n\t\t// ecriture du fichier vers f_out\n\t\tSystem.out.println(\"Ecriture du fichier \" + f_out.getPath());\n\t\tlecture.writeFile(f_out, fichier);\n\t}\n\n}\n```\n\nLicence\n-------\nLe code est sous licence [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabarhub%2Ffilerw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabarhub%2Ffilerw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabarhub%2Ffilerw/lists"}