Giter Club home page Giter Club logo

delta-updater's Introduction

Binary delta patches for directories

Utilities and library for creating and applying binary patches to file system directories. It's based on Javaxdelta library - java implementation of xdelta binary diff algorithm. GDIFF format is used for patches.

It can be used to implement auto-updating for rich-client applications.

Delta-diff and delta-patch utilities are available:

Libraries are available in Maven cental.

Javadocs: delta-diff, delta-patch

###Features

  • supports directories with arbitrary structure
  • supports changed, added and deleted files
  • directory patch includes human readable '.index' file
  • streaming patch creation and applying
  • fail-fast patch applying with hash sum checks
  • pure java, tested on linux and windows

###Directory patch creation

  • takes two directories (to create delta between) and IOFilter to include/exclude files
  • creates ZIP file (or stream) with GDIFF deltas for all changed files and '.index' text file (with '.index_' prefix) with list of unchanged, added, updated and deleted files with SHA1 hash sums

###Patch application

Patches are applied in fail-fast mode, application will be aborted on first wrong hash-sum or IO error.

  • takes directory to patch and patch file (or stream)
  • reads '.index' file and using it for futher steps:
  • checks hash sums for 'unchanged' files
  • reads from stream 'added' files, puts them into directory checking hash sums
  • check hash sums for 'updated' files
  • reads '.gdiff' patches from stream, applies them, checks hash sums for applied files
  • checks hash sums for 'deleted' files
  • deletes 'deleted' files

Using library

Maven dependency (available in central repository):

<dependency>
    <groupId>com.alexkasko.delta</groupId>
    <artifactId>delta-diff</artifactId>
    <!--artifactId>delta-patch</artifactId-->
    <version>1.1.3</version>
</dependency>

For patch file/stream creation you should use one of these methods:

 new DirDeltaCreator().create(oldDirectory, newDirectory, patchFile);
 new DirDeltaCreator().create(oldDirectory, newDirectory, filesFilter, patchOutputStream);

For patch application (it will throw IOException on hash-sum error):

new DirDeltaPatcher().patch(directory, patchFile);
new DirDeltaPatcher().patch(directory, patchZipInputStream);

Both DirDeltaCreator and DirDeltaPatcher are thread-safe (stateless).

Using utilities

delta-diff and delta-patch programs (they will be put into delta-updater/delta-xxx/target/delta-xxx-yyy-distr) can be used as command line utilities.

Patch creation:

java -jar delta-diff.jar dir1 dir2 -o patch.zip

Patch application:

java -jar delta-patch.jar dir patch.zip

How to build

All dependencies are in Maven Central. To build project run:

mvn clean install

License Information

Note: javaxdelta depends on GNU Trove 1.0.2 library which is released under the LGPL license.

This project is released under the MIT License (the same license is used by javaxdelta project).

Changelog

1.1.3 (2014-10-21)

  • fix typos in error messages (#2)

1.1.2 (2014-08-09)

  • add support for case-sensivity flag (#1)

1.1.1 (2014-01-31)

  • remove NullOutputStream usage to support recent versions of Guava

1.1 (2012-10-26)

  • code and dependencies cleanup, maven central upload

1.0 (2011-11-20)

  • initial version

delta-updater's People

Contributors

alexkasko avatar alx3apps 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.