From cd1aa392a6e17382f573ee816c26fd5f19301f02 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 14 May 2020 13:13:31 +0200 Subject: [PATCH] merge from master --- library/BasicLibrary.java | 24 +++++++++++++++++++++++- library/WebLibrary.java | 5 +++++ library/WebLibraryServer.java | 2 +- library/WebLibraryServerHtml.java | 4 +--- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/library/BasicLibrary.java b/library/BasicLibrary.java index f6024eef..8b72f19b 100644 --- a/library/BasicLibrary.java +++ b/library/BasicLibrary.java @@ -595,6 +595,28 @@ abstract public class BasicLibrary { * in case of I/O error */ public MetaData imprt(URL url, Progress pg) throws IOException { + return imprt(url, null, pg); + } + + /** + * Import the {@link Story} at the given {@link URL} into the + * {@link BasicLibrary}. + * + * @param url + * the {@link URL} to import + * @param luid + * the LUID to use + * @param pg + * the optional progress reporter + * + * @return the imported Story {@link MetaData} + * + * @throws UnknownHostException + * if the host is not supported + * @throws IOException + * in case of I/O error + */ + MetaData imprt(URL url, String luid, Progress pg) throws IOException { if (pg == null) pg = new Progress(); @@ -609,7 +631,7 @@ abstract public class BasicLibrary { throw new UnknownHostException("" + url); } - Story story = save(support.process(pgProcess), pgSave); + Story story = save(support.process(pgProcess), luid, pgSave); pg.done(); return story.getMeta(); diff --git a/library/WebLibrary.java b/library/WebLibrary.java index ac1349e7..978dd9af 100644 --- a/library/WebLibrary.java +++ b/library/WebLibrary.java @@ -353,6 +353,11 @@ public class WebLibrary extends BasicLibrary { } } + @Override + public synchronized void delete(String luid) throws IOException { + post(WebLibraryUrls.getDeleteUrlStory(luid), null).close(); + } + @Override protected void updateInfo(MetaData meta) { // Will be taken care of directly server side diff --git a/library/WebLibraryServer.java b/library/WebLibraryServer.java index 810cc4db..9073b8ca 100644 --- a/library/WebLibraryServer.java +++ b/library/WebLibraryServer.java @@ -422,7 +422,7 @@ public class WebLibraryServer extends WebLibraryServerHtml { @Override public void run() { try { - lib.imprt(url, pg); + lib.imprt(url, luid, pg); } catch (IOException e) { Instance.getInstance().getTraceHandler().error(e); } finally { diff --git a/library/WebLibraryServerHtml.java b/library/WebLibraryServerHtml.java index e96edef9..ac0631dd 100644 --- a/library/WebLibraryServerHtml.java +++ b/library/WebLibraryServerHtml.java @@ -256,9 +256,7 @@ abstract class WebLibraryServerHtml implements Runnable { } }; - if (ssf != null) - - { + if (ssf != null) { getTraceHandler().trace("Install SSL on the web server..."); server.makeSecure(ssf, null); getTraceHandler().trace("Done."); -- 2.27.0