{"id":19502327,"url":"https://github.com/zio/zio-ftp","last_synced_at":"2025-10-26T01:20:26.751Z","repository":{"id":36381208,"uuid":"220471692","full_name":"zio/zio-ftp","owner":"zio","description":"A simple, idiomatic (S)FTP client for ZIO","archived":false,"fork":false,"pushed_at":"2024-10-11T00:35:54.000Z","size":1697,"stargazers_count":29,"open_issues_count":12,"forks_count":13,"subscribers_count":5,"default_branch":"series/2.x","last_synced_at":"2025-04-04T05:11:23.501Z","etag":null,"topics":["connector","ftp","functional-programming","scala","sftp","streaming","streams","zio","zio-streams"],"latest_commit_sha":null,"homepage":"https://zio.dev/zio-ftp","language":"Scala","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/zio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-08T13:23:46.000Z","updated_at":"2024-10-11T00:33:47.000Z","dependencies_parsed_at":"2023-10-15T03:13:58.325Z","dependency_job_id":"10ea0710-7424-4f7e-892b-1ee0df55e0c4","html_url":"https://github.com/zio/zio-ftp","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-ftp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-ftp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-ftp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-ftp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zio","download_url":"https://codeload.github.com/zio/zio-ftp/tar.gz/refs/heads/series/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"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":["connector","ftp","functional-programming","scala","sftp","streaming","streams","zio","zio-streams"],"created_at":"2024-11-10T22:16:05.469Z","updated_at":"2025-10-26T01:20:26.746Z","avatar_url":"https://github.com/zio.png","language":"Scala","funding_links":[],"categories":["网络编程"],"sub_categories":["Spring Cloud框架"],"readme":"[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)\n[//]: # (So please do not edit it manually. Instead, change \"docs/index.md\" file or sbt setting keys)\n[//]: # (e.g. \"readmeDocumentation\" and \"readmeSupport\".)\n\n# ZIO FTP\n\n[ZIO FTP](https://zio.dev) is a thin wrapper over (s)Ftp client for [ZIO](https://zio.dev).\n\n[![Production Ready](https://img.shields.io/badge/Project%20Stage-Production%20Ready-brightgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-ftp/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-ftp_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-ftp_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-ftp_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-ftp_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-ftp-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-ftp-docs_2.13) [![ZIO FTP](https://img.shields.io/github/stars/zio/zio-ftp?style=social)](https://github.com/zio/zio-ftp)\n\n## Installation\n\nIn order to use this library, we need to add the following line in our `build.sbt` file:\n\n```scala\nlibraryDependencies += \"dev.zio\" %% \"zio-ftp\" % \"0.5.2\" \n```\n\n## How to use it?\n\n* Imports\n```scala\nimport zio.ftp._\n```\n\n* FTP\n```scala\n// FTP\nval unsecureSettings = UnsecureFtpSettings(\"127.0.0.1\", 21, PasswordCredentials(\"foo\", \"bar\"))\n\n//listing files\nFtp.ls(\"/\").runCollect.provideLayer(unsecure(unsecureSettings))\n```\n\n* FTPS\n```scala\n// FTPS\nval secureSettings = SecureFtpSettings(\"127.0.0.1\", 21, PasswordCredentials(\"foo\", \"bar\"))\n\n//listing files\nSFtp.ls(\"/\").runCollect.provideLayer(secure(secureSettings))\n```\n\n* SFTP (support ssh key)\n\n```scala\nval sftpSettings = SecureFtpSettings(\"127.0.0.1\", 22, PasswordCredentials(\"foo\", \"bar\"))\n\n//listing files\nSFtp.ls(\"/\").runCollect.provideLayer(secure(sftpSettings))\n```\n\n## Example\n\nFirst we need an FTP server, so let's create one:\n\n```bash\ndocker run -d \\\n    -p 21:21 \\\n    -p 21000-21010:21000-21010 \\\n    -e USERS=\"one|1234\" \\\n    -e ADDRESS=localhost \\\n    delfer/alpine-ftp-server\n```\n\nNow we can run the example:\n\n```scala\nimport zio._\nimport zio.stream._\nimport zio.ftp._\nimport zio.ftp.Ftp._\n\nimport java.io.IOException\n\nobject ZIOFTPExample extends ZIOAppDefault {\n\n  private val settings =\n    UnsecureFtpSettings(\"127.0.0.1\", 21, PasswordCredentials(\"one\", \"1234\"))\n\n  private val myApp: ZIO[Ftp, IOException, Unit] =\n    for {\n      _        \u003c- Console.printLine(\"List of files at root directory:\")\n      resource \u003c- ls(\"/\").runCollect\n      _        \u003c- ZIO.foreach(resource)(e =\u003e Console.printLine(e.path))\n      path      = \"~/file.txt\"\n      _        \u003c- upload(\n                    path,\n                    ZStream.fromChunk(\n                      Chunk.fromArray(\"Hello, ZIO FTP!\\nHello, World!\".getBytes)\n                    )\n                  )\n      file     \u003c- readFile(path)\n                    .via(ZPipeline.utf8Decode)\n                    .runCollect\n      _        \u003c- Console.printLine(s\"Content of $path file:\")\n      _        \u003c- Console.printLine(file.mkString)\n    } yield ()\n\n  override def run = myApp.provideSomeLayer(unsecure(settings))\n}\n```\n\n## Support any commands?\n\nIf you need a method which is not wrapped by the library, you can have access to underlying FTP client in a safe manner by using\n\n```scala\nimport zio._\n\ntrait FtpAccessors[+A] {\n  def execute[T](f: A =\u003e T): ZIO[Any, IOException, T]\n} \n```\n\n## Documentation\n\nLearn more on the [ZIO FTP homepage](https://zio.dev/zio-ftp/)!\n\n## Contributing\n\nFor the general guidelines, see ZIO [contributor's guide](https://zio.dev/contributor-guidelines).\n\n## Code of Conduct\n\nSee the [Code of Conduct](https://zio.dev/code-of-conduct)\n\n## Support\n\nCome chat with us on [![Badge-Discord]][Link-Discord].\n\n[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord \"chat on discord\"\n[Link-Discord]: https://discord.gg/2ccFBr4 \"Discord\"\n\n## License\n\n[License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-ftp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzio%2Fzio-ftp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-ftp/lists"}