{"id":14128158,"url":"https://github.com/lyrebirdstudio/filebox","last_synced_at":"2025-07-11T00:09:36.245Z","repository":{"id":63344623,"uuid":"238207373","full_name":"lyrebirdstudio/filebox","owner":"lyrebirdstudio","description":"Async file downloader for Android","archived":false,"fork":false,"pushed_at":"2020-02-05T16:10:13.000Z","size":641,"stargazers_count":317,"open_issues_count":3,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-16T16:22:14.744Z","etag":null,"topics":["android","async","conceal","downloader","file","filebox"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/lyrebirdstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-04T13:01:57.000Z","updated_at":"2024-07-22T04:40:41.000Z","dependencies_parsed_at":"2022-11-17T10:02:33.453Z","dependency_job_id":null,"html_url":"https://github.com/lyrebirdstudio/filebox","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrebirdstudio%2Ffilebox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrebirdstudio%2Ffilebox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrebirdstudio%2Ffilebox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyrebirdstudio%2Ffilebox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyrebirdstudio","download_url":"https://codeload.github.com/lyrebirdstudio/filebox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224193011,"owners_count":17271238,"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","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":["android","async","conceal","downloader","file","filebox"],"created_at":"2024-08-15T16:01:21.081Z","updated_at":"2024-11-12T00:15:05.320Z","avatar_url":"https://github.com/lyrebirdstudio.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/lyrebirdstudio/filebox/master/art/icon_filebox.png\"\u003e\n\u003c/p\u003e\n\n\n## What is FileBox\n\nFileBox is an async file downloader library for Android. \n\nBefore we develop filebox, we though that URL content changes very rarely. So basically this library downloads a given URL, and if it is already downloaded, it provides downloaded content directly.\n\nFileBox;\n\n* Shares ongoing download requests to the observers. So It reduces Data Usage.\n* Has TTL(Time To Live) duration. Filebox re-download the URL if TTL is expired.\n* Supports both Cache and External directory.\n* Supports the File Encryption for sensitive URL(images, videos, any file).\n* Allows you to create a custom folder destination.\n* Clears unreliable data automagically. \n* Does Etag Check. Filebox doesn't download the file again If the file's TLL(Time To Live) is up but the file has not changed.\n* Supports Multiple Download. If you have N file and want to get notified when all completed.\n* Runs on application scope. There is no pause/resume continuation support.\n\n## Flow Diagram\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/lyrebirdstudio/filebox/master/art/diagram_filebox.png\"\u003e\n\u003c/p\u003e\n\n## Modules\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/lyrebirdstudio/filebox/master/art/filebox_modules.png\"\u003e\n\u003c/p\u003e\n\n## Basic Usage\n```kotlin\nval fileBoxRequest = FileBoxRequest(\"https://url1.png\")\n\nval filebox= FileBoxProvider.newInstance(applicationContext, FileBoxConfig.createDefault())\n\nfilebox.get(fileBoxRequest)\n    .subscribeOn(Schedulers.io())\n    .observeOn(AndroidSchedulers.mainThread())\n    .subscribe { fileBoxResponse -\u003e\n        when (fileBoxResponse) {\n            is FileBoxResponse.Downloading -\u003e {\n                val progress: Float = fileBoxResponse.progress\n                val ongoingRecord: Record = fileBoxResponse.record\n            }\n            is FileBoxResponse.Complete -\u003e {\n                val savedRecord: Record = fileBoxResponse.record\n                val savedPath = fileBoxResponse.record.getReadableFilePath()\n            }\n            is FileBoxResponse.Error -\u003e {\n                val savedRecord: Record = fileBoxResponse.record\n                val error = fileBoxResponse.throwable\n            }\n        }\n    }\n```\n\n## Customize Config\n\n```kotlin\nval fileBoxConfig = FileBoxConfig.FileBoxConfigBuilder()\n        .setCryptoType(CryptoType.CONCEAL) // Default is CryptoType.NONE\n        .setTTLInMillis(TimeUnit.DAYS.toMillis(7)) // Default is 7 Days\n        .setDirectory(DirectoryType.CACHE) // Default is External\n        .setFolderName(\"MyPhotos\") // Default is none\n        .build()\n```\n\n## Multiple Download Request\n\n```kotlin\nval fileBoxMultipleRequest = FileBoxMultiRequest(\n            arrayListOf(\n                FileBoxRequest(\"https://url1.png\"),\n                FileBoxRequest(\"https://url2.zip\"),\n                FileBoxRequest(\"https://url3.json\"),\n                FileBoxRequest(\"https://url4.mp4\")\n            )\n        )\n\nval filebox = FileBoxProvider.newInstance(applicationContext, FileBoxConfig.createDefault())\n\nfilebox.get(fileBoxMultipleRequest)\n    .subscribeOn(Schedulers.io())\n    .observeOn(AndroidSchedulers.mainThread())\n    .subscribe { fileBoxResponse -\u003e\n        when (fileBoxResponse) {\n            is FileBoxMultiResponse.Downloading -\u003e {\n                val progress = fileBoxResponse.progress\n                val ongoingFileResponseList = fileBoxResponse.fileBoxResponseList\n            }\n            is FileBoxMultiResponse.Complete -\u003e {\n                val ongoingFileResponseList = fileBoxResponse.fileBoxResponseList\n                ongoingFileResponseList.forEach { it.record.getReadableFilePath() }\n            }\n            is FileBoxMultiResponse.Error -\u003e {\n                val error = fileBoxResponse.throwable\n                val ongoingFileResponseList = fileBoxResponse.fileBoxResponseList\n            }\n        }\n    }\n```\n\n## Destroy\n\nDon't forget to destroy the filebox when your initialized scope is destroyed. If you create a filebox in your application class, It is application scoped. If you create a filebox in your activity class, It is activity scoped. Be aware of your lifecycle.\n\n```kotlin\nfilebox.destroy()\n```\n\n# Setup\n```groovy\nallprojects {\n     repositories {\n\t...\n\tmaven { url 'https://jitpack.io' }\n     }\n}\n```\n```groovy\ndependencies {\n      implementation 'com.github.lyrebirdstudio:filebox:0.1'\n}\n```\n\nLicense\n--------\n\n\n    Copyright 2020 Lyrebird Studio.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyrebirdstudio%2Ffilebox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyrebirdstudio%2Ffilebox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyrebirdstudio%2Ffilebox/lists"}