Repository for the PB-Sys library

Table of Contents


Intro

This is a compilation of useful system utilities that are useful for small and large projects. It was initially developed to be used inside the Play Framework to provide encryption capabilities that the Play Framework is lacking.

How to Use-it

  1. Download compile and build with sbt

    sbt compile
    sbt assembly
    
  2. Just add the jar package to your project

Note: although part of the source code is developed in Scala, it should all work in a Java environment.

Features

  • Encryption:

    • It depends on Kalium and libsodium library for it's crypto functions. Note that libsodium needs to be installed on the OS.
  • Processes:

    • it used Scala ProcessBuilder to run, process progress and return stdout, stderr and exit status.
  • File system utilities

  • Java Reflection utilities

  • OS dependent operations

Dependencies

  • JSON: "com.typesafe.play" %% "play-json" % "2.6.2" % "provided"
  • Encryption: "org.abstractj.kalium" % "kalium" % "0.7.0"
  • Libsodium (needs to be instaled in OS): https://download.libsodium.org/doc/

How to install libsodium on the OS

Linux

sudo apt-get install libsodium-dev

OSX

brew install libsodium

Windows

  • Download libsodium from https://download.libsodium.org/libsodium/releases/
    • The archives follow the following pattern: libsodium-{version}-msvc.zip
  • Decompress the file
  • Go to the binary folder (32 or 64 bits), for ex: .\libsodium-win64\bin.
  • Make a copy and change the dll filename to libsodium.dll
  • Copy the file to windows\system32 folder