{"id":21214788,"url":"https://github.com/filestack/filestack-java","last_synced_at":"2025-07-10T10:30:39.748Z","repository":{"id":66363039,"uuid":"93534425","full_name":"filestack/filestack-java","owner":"filestack","description":"Official Java SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.","archived":false,"fork":false,"pushed_at":"2024-09-11T17:51:48.000Z","size":2333,"stargazers_count":18,"open_issues_count":5,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-12T03:34:01.823Z","etag":null,"topics":["file-management","file-upload","image-processing","java","sdk","video-processing"],"latest_commit_sha":null,"homepage":"https://filestack.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filestack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2017-06-06T15:32:21.000Z","updated_at":"2024-09-11T17:36:22.000Z","dependencies_parsed_at":"2024-07-29T14:19:13.863Z","dependency_job_id":"8849d97b-fc8a-49ab-a180-93cb3cd46dd9","html_url":"https://github.com/filestack/filestack-java","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filestack%2Ffilestack-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filestack%2Ffilestack-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filestack%2Ffilestack-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filestack%2Ffilestack-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filestack","download_url":"https://codeload.github.com/filestack/filestack-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225632846,"owners_count":17499874,"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":["file-management","file-upload","image-processing","java","sdk","video-processing"],"created_at":"2024-11-20T21:31:00.150Z","updated_at":"2024-11-20T21:31:00.707Z","avatar_url":"https://github.com/filestack.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"logo.svg\" align=\"center\" width=\"100\"/\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eFilestack Java SDK\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://bintray.com/filestack/maven/filestack-java\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/bintray-v0.8.0-blue.svg?longCache=true\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://filestack.github.io/filestack-java/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/ref-javadoc-795548.svg?longCache=true\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/java_version-7-green.svg?longCache=true\u0026style=flat-square\"\u003e\n  \u003ca href=\"https://travis-ci.org/filestack/filestack-java\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/filestack/filestack-java.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/filestack/filestack-java\"\u003e\n    \u003cimg src=\"https://img.shields.io/coveralls/filestack/filestack-java.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Java SDK for Filestack. Includes wrappers for Core, Upload, Transformation, and Cloud APIs. Supports Amazon Drive, Box, Dropbox, Facebook, GitHub, Gmail, Google Drive, Google Photos, Instagram, and OneDrive.\n\u003c/p\u003e\n\n## Install\n```\nimplementation 'org.filestack:filestack-java:1.0.1'\n```\n\n## Upload\n```java\n// Create a client\nConfig config = new Config(\"API_KEY\");\nClient client = new Client(config);\n\n// Set options and metadata for upload\nStorageOptions options = new StorageOptions.Builder()\n    .mimeType(\"text/plain\")\n    .filename(\"hello.txt\")\n    .build();\n\n// Perform a synchronous, blocking upload\nFileLink file = client.upload(\"/path/to/file\", false);\n\n// Perform an asynchronous, non-blocking upload\nFlowable\u003cProgress\u003cFileLink\u003e\u003e upload = client.uploadAsync(\"/path/to/file\", false);\nupload.doOnNext(new Consumer\u003cProgress\u003cFileLink\u003e\u003e() {\n  @Override\n  public void accept(Progress\u003cFileLink\u003e progress) throws Exception {\n    System.out.printf(\"%f%% uploaded\\n\", progress.getPercent());\n    if (progress.getData() != null) {\n      FileLink file = progress.getData();\n    }\n  }\n});\n```\n\n## Asynchronous Functions\nEvery function that makes a network call has both a synchronous (blocking) and asynchronous (non-blocking) version. The asynchronous versions return [RxJava][rxjava-repo] classes (Observable, Single, Completable).\n\nFor example to delete a file both synchronously and asynchronously:\n```java\n// Synchronous, blocking\nfileLink.delete();\n\n// Asynchronous, not blocking\nfileLink.deleteAsync().doOnComplete(new Action() {\n  @Override\n  public void run() throws Exception {\n    System.out.println(\"File deleted.\");\n  }\n});\n```\n\n## FileLink Operations\n```\nString handle = fileLink.getHandle(); // A handle is a file ID\nfileLink.download(\"/path/to/save/file\");\nfileLink.delete();\nfileLink.overwrite(\"/path/to/new/file\");\n```\n\n## Transformations\nThe transform functions generate URLs for backend transformations; No local processing occurs. With the exception of video transformations, front-end clients can directly use the generated URLS.\n\nFor example, to reduce image bandwidth usage, generate resize transform URLs based on display size:\n```java\nResizeTask task = new ResizeTask.Builder()\n    .width(100)\n    .fit(\"center\")\n    .build();\nImageTransform transform = fileLink.imageTransform().addTask(task);\nString url = transform.url();\n```\n\n## Cloud Transfers\n\n```java\n// Check a user's auth status by first trying to list contents of drive\nCloudResponse response = client.getCloudItems(Sources.GOOGLE_DRIVE, \"/\");\nString authUrl = response.getAuthUrl();\n// If auth URL isn't null, user needs to authenticate, open URL in browser\nif (authUrl != null) {\n    openBrowser(authUrl);\n    return;\n}\n\n// Transfer the first file from the cloud provider to Filestack\nCloudItem first = response.getItems()[0];\nclient.storeCloudItem(Sources.GOOGLE_DRIVE, first.getPath());\n\n// Check for another page of results\nString nextToken = response.getNextToken();\n// If next token isn't null, there's more items to fetch\nif (nextToken != null) {\n  response = client.getCloudItems(Sources.GOOGLE_DRIVE, \"/\", nextToken);\n}\n\n// Save the session token\nString sessionToken = client.getSessionToken();\nsaveSessionToken(sessionToken);\n```\n\n## Cloud Auth States\nThere are 3 levels of state to note with cloud integrations: 1) the local state (stored by a session token) 2) the authorization state between the user's cloud account and Filestack (on the backend) and 3) (potentially) the login state within the browser where users complete the OAuth login.\n\nA session token determines the auth state between an app and Filestack. Every response includes a refreshed token, and every request should send the last token received. Tokens do not just identify a session, they hold the session state. For example if a user logs out of a cloud, only the token returned by the logout response reflects that action; Using the old token would still allow listing the contents of the logged out cloud. To maintain state across client destruction, export and save the token.\n\nThe auth state in the local session does not connect to the authorization state between a cloud account and Filestack. For example a user can log out of an account in a local session, but still see Filestack as authorized in the cloud provider's settings. A user must revoke access to Filestack within a provider to truly disconnect Filestack.\n\nUsers complete the OAuth flow (aka login to their clouds) in a browser, and the browser state can cause confusion. For example if a user logs into a cloud they previously logged out of, the OAuth flow may work differently because they've already logged in within the browser, and have already authorized Filestack to that cloud.\n\n## Running Tests and Linting\nTo run tests:\n```shell\n./gradlew test\n```\n\nThe project also has Checkstyle setup for code linting. The config is at `config/checkstyle/checkstyle.xml`. To run:\n```shell\n./gradlew check # Runs linter and unit tests\n```\n\n## Proguard\nIf you are using Proguard, please include entries from [this file](src/main/resources/META-INF/proguard/filestack.pro) in your Proguard configuration file.\n\nPlease note, that those rules will probably decrease in size as we proceed with getting rid of most of external dependencies.\n\n## Deployment\n_This is for Filestack devs._ Deployments are made to Bintray. You must have an account that's been added to the Filestack organization to deploy. Also make sure to follow general Filestack release guidelines. \"BINTRAY_USER\" and \"BINTRAY_API_KEY\" environment variables are required. To run:\n\n```shell\nexport BINTRAY_USER=''\nexport BINTRAY_API_KEY=''\n./gradlew bintrayUpload\n```\n\n[rxjava-repo]: https://github.com/ReactiveX/RxJava\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilestack%2Ffilestack-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilestack%2Ffilestack-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilestack%2Ffilestack-java/lists"}