1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-12 17:26:13 +00:00

#254: display documents in grid + concept of main file

This commit is contained in:
Benjamin Gamard
2018-11-01 16:27:35 +01:00
parent eb9e0e0543
commit cee82f39c2
18 changed files with 159 additions and 16 deletions

View File

@@ -154,6 +154,16 @@ public class ClientUtil {
return authToken;
}
/**
* Add a file to a document.
*
* @param file File path
* @param filename Filename
* @param token Authentication token
* @param documentId Document ID
* @return File ID
* @throws IOException e
*/
public String addFileToDocument(String file, String filename, String token, String documentId) throws IOException {
try (InputStream is = Resources.getResource(file).openStream()) {
StreamDataBodyPart streamDataBodyPart = new StreamDataBodyPart("file", is, filename);