+ /**
+ * Stop the server.
+ *
+ * @throws IOException
+ * in case of I/O errors
+ */
+ public void stop() throws IOException {
+ try {
+ post(WebLibraryUrls.EXIT_URL, null).close();
+ } catch (Exception e) {
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e1) {
+ }
+ if (getStatus() != Status.UNAVAILABLE) {
+ throw new IOException("Cannot exit the library", e);
+ }
+ }
+ }
+