Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

The org.opencode4workspace.endpoints.FilePostToSpaceEndpoint is used to post a file to a Space and retrieve a FileResponse object corresponding to a successful posting.

...

If the posting is successful, a FileResponse object is returned comprising the String id of the file, the String name of the file, the int size of the file in bytes, a Map of URLs for the file (metadata, no-redirect download, and redirect download), the Long created timestamp, the String id of the creator and the String contentType of the file.

...

titleImage Size Not Supported

...

.

...

Examples

Code Block
languagejava
titlepostFile
collapsetrue
File file = new File("C:/Temp/test.doc");
FileResponse response = client.postFileToSpace(file, spaceId);
assert (!"".equals(response.getName()));
assert (appId.equals(response.getCreatedBy()));
Code Block
languagejava
titlepostPhoto
collapsetrue
File photo = new File("C:/Temp/testPhoto.jpg");
FileResponse response = client.postFileToSpace(photo, spaceId, "50x50");
assert (!"".equals(response.getName()));
assert (appId.equals(response.getCreatedBy()))