@@ -1309,15 +1309,18 @@ public PrivateMediaFileInfo uploadPrivateMedia(
13091309 * size, but the best in quality variant of the media, according to the width provided
13101310 * @param download if <code>true</code>, the node will add <code>Content-Disposition: attachment</code> header to
13111311 * the output
1312+ * @param ignoremalware if <code>true</code>, the node will ignore malware detection and return the media file;
1313+ * only admin may use this option
13121314 * @param responseConsumer consumer of the data received
13131315 */
13141316 public void getPrivateMedia (
1315- String id , Integer width , Boolean download , ResponseConsumer responseConsumer
1317+ String id , Integer width , Boolean download , Boolean ignoremalware , ResponseConsumer responseConsumer
13161318 ) throws MoeraNodeException {
13171319 var location = "/media/private/%s/data" .formatted (ue (id ));
13181320 var params = new QueryParam [] {
13191321 QueryParam .of ("width" , width ),
1320- QueryParam .of ("download" , download )
1322+ QueryParam .of ("download" , download ),
1323+ QueryParam .of ("ignoremalware" , ignoremalware )
13211324 };
13221325 call (location , params , "GET" , null , responseConsumer );
13231326 }
@@ -1334,6 +1337,21 @@ public PrivateMediaFileInfo getPrivateMediaInfo(String id) throws MoeraNodeExcep
13341337 return call (location , null , "GET" , null , returnTypeRef );
13351338 }
13361339
1340+ /**
1341+ * Update media file details.
1342+ *
1343+ * @param id media file ID
1344+ * @param attributes attributes
1345+ * @return PrivateMediaFileInfo
1346+ */
1347+ public PrivateMediaFileInfo updatePrivateMediaInfo (
1348+ String id , PrivateMediaFileAttributes attributes
1349+ ) throws MoeraNodeException {
1350+ var location = "/media/private/%s/info" .formatted (ue (id ));
1351+ var returnTypeRef = new TypeReference <PrivateMediaFileInfo >() {};
1352+ return call (location , null , "PUT" , attributes , returnTypeRef );
1353+ }
1354+
13371355 /**
13381356 * Get the list of all postings and comments the media file is attached to.
13391357 *
@@ -2218,6 +2236,19 @@ public AsyncOperationCreated verifyRemoteCommentReaction(
22182236 return call (location , null , "POST" , Collections .emptyMap (), returnTypeRef );
22192237 }
22202238
2239+ /**
2240+ * Download the private media file from the remote node and store it at the home node.
2241+ *
2242+ * @param nodeName name of the remote node
2243+ * @param id id of the media file
2244+ * @return PrivateMediaFileInfo
2245+ */
2246+ public PrivateMediaFileInfo downloadRemoteMedia (String nodeName , String id ) throws MoeraNodeException {
2247+ var location = "/nodes/%s/media/private/%s/download" .formatted (ue (nodeName ), ue (id ));
2248+ var returnTypeRef = new TypeReference <PrivateMediaFileInfo >() {};
2249+ return call (location , null , "POST" , Collections .emptyMap (), returnTypeRef );
2250+ }
2251+
22212252 /**
22222253 * Add a posting to the remote node and register it in the registry at the local node.
22232254 *
0 commit comments