Archives mensuelles : mai 2020

Linux Bash Script to install and uninstall a JAR

#!/bin/bash   psLine=$(ps aux | grep ‘[j]ava -jar.*demo-.*.jar.*’) # -n not empty, z empty if [ -n "$psLine" ] ; then currentPid=$(echo $psLine | awk ‘{print $2}’) echo Current appli running detected with pid=$currentPid printf "First, we stop the current … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Java 8 : date and time

Temporal formatting Parsing a String to get a date/time objects (Too) Generic way : DateTimeFormatter df = …; TemporalAccessor d = df.parse("dd/mmmm/…)"; Good for generic processing : DateTimeFormatter df = …; LocalDateTime d = df.parse("dd/mmmm/…", LocalDateTime::from); Good for one shot processing … Continuer la lecture

Publié dans Non classé | Laisser un commentaire