implemented storing of bookmarks
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -11,6 +11,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation("de.srsoftware:tools.mime:1.1.2")
|
||||
implementation("de.srsoftware:tools.util:2.0.4")
|
||||
implementation("org.xerial:sqlite-jdbc:3.49.0.0")
|
||||
testImplementation(platform("org.junit:junit-bom:5.10.0"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.srsoftware.umbrella.core;
|
||||
|
||||
import static de.srsoftware.tools.MimeType.MIME_FORM_URL;
|
||||
import static de.srsoftware.tools.MimeType.MIME_JSON;
|
||||
import static de.srsoftware.tools.Strings.hex;
|
||||
import static de.srsoftware.umbrella.core.Constants.*;
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
@@ -16,6 +17,8 @@ import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
@@ -29,6 +32,15 @@ public class Util {
|
||||
private static final Pattern UML_PATTERN = Pattern.compile("@start(\\w+)(.*)@end(\\1)",Pattern.DOTALL);
|
||||
private static File plantumlJar = null;
|
||||
private static final JParsedown MARKDOWN = new JParsedown();
|
||||
private static final MessageDigest SHA1;
|
||||
|
||||
static {
|
||||
try {
|
||||
SHA1 = MessageDigest.getInstance("SHA-1");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private Util(){}
|
||||
|
||||
@@ -155,6 +167,11 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static String sha1(String plain){
|
||||
var bytes = SHA1.digest(plain.getBytes(UTF_8));
|
||||
return hex(bytes);
|
||||
}
|
||||
|
||||
public static void setPlantUmlJar(File file){
|
||||
LOG.log(INFO,"Using plantuml @ {0}",file.getAbsolutePath());
|
||||
plantumlJar = file;
|
||||
|
||||
Reference in New Issue
Block a user