merge from master
[nikiroo-utils.git] / library / WebLibrary.java
index 978dd9af51c05e5b56f93c2d61948e34fcbcc968..7566877cebd48343b47c1764ed31045ee8de78dd 100644 (file)
@@ -126,6 +126,16 @@ public class WebLibrary extends BasicLibrary {
                return new Version();
        }
 
+       /**
+        * Stop the server.
+        * 
+        * @throws IOException
+        *             in case of I/O errors
+        */
+       public void stop() throws IOException {
+               post(WebLibraryUrls.EXIT_URL, null).close();
+       }
+
        @Override
        public Status getStatus() {
                try {
@@ -309,6 +319,9 @@ public class WebLibrary extends BasicLibrary {
                                try {
                                        subPg = JsonIO.toProgress(
                                                        new JSONObject(IOUtils.readSmallStream(in)));
+                                       pg.setName(subPg.getName());
+                                       pg.setMinMax(subPg.getMin(), subPg.getMax());
+                                       pg.setProgress(subPg.getProgress());
                                } catch (Exception e) {
                                        subPg = null;
                                } finally {