{"id":18886718,"url":"https://github.com/supabase-community/storage-java","last_synced_at":"2025-04-14T21:31:13.433Z","repository":{"id":64508101,"uuid":"575544245","full_name":"supabase-community/storage-java","owner":"supabase-community","description":"A Java client library for the Supabase Storage API ","archived":false,"fork":false,"pushed_at":"2024-09-16T11:25:33.000Z","size":645,"stargazers_count":14,"open_issues_count":8,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-02T15:27:38.149Z","etag":null,"topics":["java","supabase","supabase-storage"],"latest_commit_sha":null,"homepage":"https://supabase-community.github.io/storage-java/","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/supabase-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2022-12-07T18:47:49.000Z","updated_at":"2024-09-27T14:30:59.000Z","dependencies_parsed_at":"2024-10-19T11:30:33.648Z","dependency_job_id":null,"html_url":"https://github.com/supabase-community/storage-java","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":0.574468085106383,"last_synced_commit":"71c5acefef87428b9f825b5064bcdb650ebd516e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase-community","download_url":"https://codeload.github.com/supabase-community/storage-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223382648,"owners_count":17136452,"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":["java","supabase","supabase-storage"],"created_at":"2024-11-08T07:30:16.799Z","updated_at":"2024-11-08T07:30:17.397Z","avatar_url":"https://github.com/supabase-community.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg width=\"300\" src=\".github/supabase-storage.png\"/\u003e\n\u003c/p\u003e\n\n# storage-java\nAn async Java client library for the [Supabase Storage API](https://github.com/supabase/storage-api)\n\nThe version being used supports different version of the storage API, you can find which version supports up to what version in the [CHANGELOG](./CHANGELOG.md)\n\n## Installation\nFor installation please see the [packages](https://github.com/supabase-community/storage-java/packages) section, it will show you how the dependency block should look.\n\n## Example\n\n```java\nimport io.supabase.StorageClient;\nimport io.supabase.api.IStorageFileAPI;\nimport io.supabase.data.bucket.CreateBucketResponse;\nimport io.supabase.data.file.*;\n\nimport java.io.File;\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ExecutionException;\n\npublic class Main {\n    public static void main(String[] args) {\n        String url = System.getenv(\"SUPABASE_URL\");\n        String serviceToken = System.getenv(\"SUPABASE_SERVICE_TOKEN\");\n\n        StorageClient storageClient = new StorageClient(serviceToken, url);\n\n        // Interact with Supabase Storage\n        CompletableFuture\u003cCreateBucketResponse\u003e res = storageClient.createBucket(\"examplebucket\");\n\n        // Do something on future completion.\n        res.thenAccept((bucketRes) -\u003e {\n            IStorageFileAPI fileAPI = storageClient.from(bucketRes.getName());\n            try {\n                // We call .get here to block the thread and retrieve the value or an exception.\n                // Pass the file path in supabase storage and pass a file object of the file you want to upload.\n                FilePathResponse response = fileAPI.upload(\"my-secret-image/image.png\", new File(\"file-path-to-image.png\")).get();\n\n                // Generate a public url (The link is only valid if the bucket is public).\n                fileAPI.getPublicUrl(\"my-secret-image/image.png\", new FileDownloadOption(false), new FileTransformOptions(500, 500, ResizeOption.COVER, 50, FormatOption.NONE));\n\n                // Create a signed url to download an object in a private bucket that expires in 60 seconds, and will be downloaded instantly on link as \"my-image.png\"\n                fileAPI.getSignedUrl(\"my-secret-image/image.png\", 60, new FileDownloadOption(\"my-image.png\"), null);\n\n                // Download the file\n                fileAPI.download(\"my-secret-image/image.png\", null);\n\n            } catch (InterruptedException | ExecutionException e) {\n                throw new RuntimeException(e);\n            }\n        });\n    }\n}\n\n```\n\n## Package made possible through the efforts of: \n\u003ca href=\"https://github.com/supabase-community/storage-java/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=supabase-community/storage-java\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n\n## Contributing\n\nWe are more than happy to have contributions! Please submit a PR.\n\n### Local development\nFor testing the application you will need to spin up the docker compose found in the `infra` folder.\n\u003cbr\u003e\n1. `cd infra`.\n2. `cp .env.example .env`\n3. Fill in the values of the .env\n4. `docker compose up -d`\n\u003cp\u003eThen you can test the application with the default values already in the test files.\u003c/p\u003e \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase-community%2Fstorage-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase-community%2Fstorage-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase-community%2Fstorage-java/lists"}