Giter Site home page Giter Site logo

nio.file's Introduction

nio.file

Clojure wrapper for java.nio.file

Why do this? Take a look at WHY.md.

Work in progress! Expect bugs and missing functionality until we hit 1.0.0.

Supported Clojure and Java Versions

nio.file targets Clojure 1.6+ and Java 1.7+. New features in future versions of Java will be implemented conditionally so that that you can continue to use this library on 1.7.

Maturity

This is alpha quality software. If your usage requires a complete and bug free experience, please wait for 1.0.0.

Installation

nio.file is available as a Maven artifact from Clojars:

[org.tobereplaced/nio.file "0.4.0"]

nio.file follows Semantic Versioning. Please note that this means the public API for this library is not yet considered stable.

Documentation

Please read the Codox API Documentation and take a look at walkthrough.clj.

What Belongs Here?

The goal of this library is to make it so that everything you could do with java.nio.file, you can do easier with this library.

Towards this goal, if you find something that you must reach directly to java.nio.file for, please file an issue. It must be rectified.

This is not a utility library. This library is only here to make java.nio.file easier to use. Consequently, most functions herein are just wrappers around existing java methods with coercion where appropriate. The rest of the library is made up of constructor functions to implement required interfaces for arguments to the existing java methods.

As an example, implementing "remove-directory" is out of scope. However, walkthrough.clj will show you how to do that and other utility-like-things quite easily.

Contributing

Pull requests welcome! Check out the TODO items in the source code. Engage with me! There's a lot of work, and I don't have time for all of it.

We need lots of tests and some guided examples in the walkthrough.clj.

Support

Please post any comments, concerns, or issues to the Github issues page or find me on #clojure. I welcome any and all feedback.

Changelog

v0.4.0

  • Make posix-file-permissions return a PersistentHashSet.

v0.3.1

  • Fix typo in file-visitor.

v0.3.0

  • Rename copy to copy! and move to move!.

v0.2.0

  • Rename write to write!
  • Add functions and extend functionality for working with PosixFilePermissions

v0.1.0

  • Initial Release
  • Most Files FileSystem and Path methods implemented

License

Copyright © 2014 ToBeReplaced

Distributed under the Eclipse Public License, the same as Clojure. The license can be found at LICENSE in the root of this distribution.

nio.file's People

Contributors

jonathn avatar noisesmith avatar tobereplaced avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nio.file's Issues

Functionality for deleting and copying directories

I'm trying to migrate my code from me.raynes.fs away to this library. First off because it seems to be better maintained but also because it is based on modern Java APIs. The last functionality that has no equivalent in nio.file are the functions delete-dir and copy-dir. I understand that you do not want this to be a utility library. This however will foster a copy and paste culture based of your walkthrough.clj. I have already implemented a delete-dir based on your example and some inspiration from the ant delete task so that it would work for nfs mounted directories. I will have to implement a tree walker for copying.

For now, I guess, we can put this code in walkthrough.clj (expect some pull requests) but I think in the long run this should be included maybe in a separate namespace.

posix-file-permissions returns java.util.Hashset

If I read posix-file-permissions correctly it returns a java.util.HashSet. This caught me by surprise when I was trying to conj another permission to it. I guess I expected a clojure set. This might be more idiomatic.

I'd rather do

(conj (nio/posix-file-permissions dir) (nio/posix-file-permission :group-write))

instead of

(doto (nio/posix-file-permissions dir) (.add (nio/posix-file-permission :group-write)))

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.