Updated shutdownToken and added server shutdown description in readme

Change-Id: I30b67730b9d42dd2b8cab2a44f58afa09f475ad9
diff --git a/README.md b/README.md
index b7c63b6..8837b04 100644
--- a/README.md
+++ b/README.md
@@ -96,15 +96,18 @@
 
 	kustvakt.base.url=/kustvakt/api/*
 
-### Setting Default Layers
+### Setting Default Foundries
 
-The values of the following properties are foundries. 
+These properties define the default foundries used for specific layers, 
+for instance in a rewrite, a default foundry may be added to a Koral query
+missing a foundry.   
+   
 
-	default.layer.partOfSpeech = tt
-	default.layer.lemma = tt
-	default.layer.orthography = opennlp
-	default.layer.dependency = mate
-	default.layer.constituent = corenlp
+	default.foundry.partOfSpeech = tt
+	default.foundry.lemma = tt
+	default.foundry.orthography = opennlp
+	default.foundry.dependency = malt
+	default.foundry.constituent = corenlp
 
 
 # Running Kustvakt Server
@@ -116,7 +119,9 @@
 java -jar target/Kustvakt-[lite/full]-[version].jar    
 </pre>
 
-To run Kustvakt with a custom spring XML config, the config must be included in the classpath. For instance:
+To run Kustvakt with a custom spring XML configuration file, it must be included in the classpath. For instance:
+```custom-spring-config.xml``` is located in ```config``` folder. 
+The ```config``` folder must be included in the classpath with ```-cp``` command.
 
 <pre>
 cd target/
@@ -124,8 +129,21 @@
 --spring-config custom-spring-config.xml
 </pre>
 
-where ```custom-spring-config.xml``` is in the ```config``` folder.
 
+# Shutting down Kustvakt Server
+
+Kustvakt server can be shut down by sending a POST request with a shutdown token. When Kustvakt server is started, a shutdown token is automatically generated and written to a ```shutdownToken``` file with the following format:
+
+<pre>
+token=[shutdown-token]
+</pre>
+
+A shutdown request can be sent as follows.
+
+<pre>
+curl -H "Content-Type: application/x-www-form-urlencoded" 
+"http://localhost:8089/shutdown" -d @shutdownToken  
+</pre>
 
 # Advanced Setup
 
diff --git a/core/Changes b/core/Changes
index edb5954..5d8758f 100644
--- a/core/Changes
+++ b/core/Changes
@@ -21,7 +21,10 @@
 28/01/2019
    - Updated Rewrite handler (margaretha)
 29/01/2019
-   - Handled "no resource found" cases (margaretha, issue #37)   
+   - Handled "no resource found" cases (margaretha, issue #37)
+30/01/2019
+   - Updated shutdownToken (margaretha)
+   - Added server shutdown description in readme (margaretha) 
 
 version 0.61.4
 14/11/2018
diff --git a/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
index eb3a76b..c5a8648 100644
--- a/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
+++ b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
@@ -101,7 +101,8 @@
         FileOutputStream fos = new FileOutputStream(new File("shutdownToken"));
         OutputStreamWriter writer =
                 new OutputStreamWriter(fos, StandardCharsets.UTF_8.name());
-        writer.write(shutdownToken);
+        writer.append("token=");
+        writer.append(shutdownToken);
         writer.flush();
         writer.close();
 
diff --git a/full/Changes b/full/Changes
index f9a2efc..30c8dee 100644
--- a/full/Changes
+++ b/full/Changes
@@ -39,7 +39,8 @@
    - Fixed share VC type (margaretha)
    - Added delete setting controller (margaretha)
    - Handled "no resource found" cases (margaretha, issue #37)
-   
+30/01/2019
+   - Added server shutdown description in readme (margaretha) 
 
 # version 0.61.4
 14/11/2018