Code Monkey home page Code Monkey logo

rebekka's Introduction

rebekka

Rebekka - an FTP/FTPS client in Swift. Utilizes CFFTPStream API from CFNetworking.

###Implemented FTP commands

  • Directory content listing.
  • Directory creation.
  • File upload/download.

###Installation

#####As Embedded framework (iOS 8.0+)

  1. Add Rebekka as a submodule. git submodule add [email protected]:Constantine-Fry/rebekka.git
  2. Drag-and-drop Rebekka.xcodeproj into your project. The project has two targets: Rebekka.framework for OSX project, RebekkaTouch.framework for iOS projects.
  3. Add new target in "Build Phases" -> "Target Dependencies".
  4. Click the + button at the top left of the panel and choose "New copy files phase".
  • Rename the new phase to "Copy Frameworks".
  • Set the "Destination" to "Frameworks".
  1. Add Rebekka framework to this phase.

To support iOS 7.0, you can add source code files directly into your project .

###Usage

var configuration = SessionConfiguration()
configuration.host = "ftp://ftp.mozilla.org:21"
configuration.encoding = NSUTF8StringEncoding
_session = Session(configuration: configuration)
_session.list("/") {
    (resources, error) -> Void in
    println("List directory with result:\n\(resources), error: \(error)\n\n")
}
var configuration = SessionConfiguration()
configuration.host = "127.0.0.1"
_session = Session(configuration: configuration)
_session.download("/Users/foo/testdownload.png") {
   (fileURL, error) -> Void in
   println("Download file with result:\n\(fileURL), error: \(error)\n\n")
}
var configuration = SessionConfiguration()
configuration.host = "localhost:21"
configuration.username = "optimus"
configuration.password = "rollout"
if let URL = NSBundle.mainBundle().URLForResource("testUpload", withExtension: "png") {
   let path = "/Users/foo/bar/testUpload.png"
   _session.upload(URL, path: path) {
       (result, error) -> Void in
       println("Upload file with result:\n\(result), error: \(error)\n\n")
  }
}

###Requirements

Swift 2.0 / iOS 8.0+ / Mac OS X 10.9+

###License

The BSD 2-Clause License. See License.txt for details.

=========== Bonn, December 2015.

rebekka's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.