Commit a4dc1e52 authored by Stefan Funk's avatar Stefan Funk
Browse files

Merge branch 'release/3.6.1'

parents bee7b31f d193bfe0
# 3.6.1
* Refactor readResponse() method of dariah-storage-client: No IOException is thrown anymore, instead it returns ALWAYS the response only, please check return status codes!
# 3.6.0
* Move many methods from crud-common to commons to avoid cyclic dependencies. TG- and DH-crud now use all the common methods from common, not from crud-common. Please adapt all your crud-common dependencies!
......@@ -7,7 +7,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>cli-tools</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>confclient</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>const</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>dariah-storage-client</artifactId>
......
......@@ -60,6 +60,7 @@ public class DariahStorageClient implements Serializable {
private static final String LOG = " ";
private static final String STORAGE_SAYS = "Storage says: ";
private static final String ERROR_CREATING = "Error creating file! " + STORAGE_SAYS;
private static final String ERROR_READING = "Error reading file! " + STORAGE_SAYS;
private static final String ERROR_UPDATING = "Error updating file! " + STORAGE_SAYS;
private static final String ERROR_DELETING = "Error deleting file! " + STORAGE_SAYS;
private static final String ERROR_CHECKING_ACCESS = "Error checking access! " + STORAGE_SAYS;
......@@ -169,15 +170,26 @@ public class DariahStorageClient implements Serializable {
* @throws IOException
*/
public InputStream readFile(String id, String token, String logID) throws IOException {
return (InputStream) readResponse(id, token, logID).getEntity();
Response response = readResponse(id, token, logID);
// Only 200 and 204 are acceptable as response!
if (response.getStatus() != Status.OK.getStatusCode()
&& response.getStatus() != Status.NO_CONTENT.getStatusCode()) {
String message = logID + ERROR_READING + response.getStatus() + " "
+ response.getStatusInfo().getReasonPhrase();
this.defaultLogger.log(Level.SEVERE, message);
throw new IOException(message);
}
return (InputStream) response.getEntity();
}
/**
* @param id
* @return
* @throws IOException
*/
public Response readResponse(String id) throws IOException {
public Response readResponse(String id) {
return readResponse(id, null, null);
}
......@@ -185,9 +197,8 @@ public class DariahStorageClient implements Serializable {
* @param id
* @param token
* @return
* @throws IOException
*/
public Response readResponse(String id, String token) throws IOException {
public Response readResponse(String id, String token) {
return readResponse(id, token, null);
}
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.utils</groupId>
<artifactId>esutils</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.utils</groupId>
<artifactId>httpclients</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>jpairtree</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>ltputils</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.namespaces</groupId>
<artifactId>metadata-core-jaxb</artifactId>
......
......@@ -6,7 +6,7 @@
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<name>DARIAHDE :: Common Tools and Packages</name>
<version>3.6.0</version>
<version>3.6.1</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.namespaces</groupId>
<artifactId>portalconfig-jaxb</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.namespaces</groupId>
<artifactId>projectfile-jaxb</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>rdfutils</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</parent>
<groupId>info.textgrid.middleware.clients</groupId>
<artifactId>textgrid-clients</artifactId>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment