Coder Social home page Coder Social logo

clj-ftp's Introduction

clj-ftp

Wrapper over Apache Commons Net to provide easy access from Clojure.

Note: FTP is considered insecure. Data and passwords are sent in the clear so someone could sniff packets on your network and discover your password. Nevertheless, FTP access is useful for dealing with anonymous FTP servers and situations where security is not an issue.

Available on Clojars

https://clojars.org/com.velisco/clj-ftp

Leiningen dependencies:

[com.velisco/clj-ftp "0.3.1"]

Double check on Clojars in case I forget to update the version number in this document.

Usage

(require '[miner.ftp :as ftp])

(ftp/with-ftp [client "ftp://anonymous:[email protected]/pub"]
	(ftp/client-get client "interesting.txt" "stuff.txt"))

By default, we use a passive local data connection. You can override that by passing an option after the URL. Use :local-data-connection-mode :active if you don't want passive mode. For example:

(ftp/with-ftp [client "ftp://anonymous:[email protected]/pub" 
               :local-data-connection-mode :active]
	(ftp/client-get client "interesting.txt" "stuff.txt"))

The default file-type for transfers is :ascii, but you can change it with the option :file-type :binary in with-ftp. Use client-set-file-type to set it appropriately before each transfer.

License

Copyright © 2012-14 Stephen E. Miner

Distributed under the Eclipse Public License, the same as Clojure.

clj-ftp's People

Contributors

miner avatar cneira avatar christianblunden avatar gphil avatar sgt avatar stpanning avatar

Watchers

James Cloos 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.