Package com.mimecast.robin.endpoints
Class StoreDraftOperations
java.lang.Object
com.mimecast.robin.endpoints.StoreDraftOperations
Handles draft-related store operations.
Operations include:
- Create draft (POST /store/{domain}/{user}/drafts)
- Update draft (PUT /store/{domain}/{user}/drafts/{draftId})
- Delete draft (DELETE /store/{domain}/{user}/drafts/{draftId})
- Add attachment (POST /store/{domain}/{user}/drafts/{draftId}/attachments)
- Delete attachment (DELETE /store/{domain}/{user}/drafts/{draftId}/attachments/{attachmentId})
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StoreHandlerprivate static final org.apache.logging.log4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidhandleAddAttachment(HttpExchange exchange, Path userRoot, String draftId) private voidhandleCreate(HttpExchange exchange, Path draftsNew) private voidhandleDelete(HttpExchange exchange, Path userRoot, Path draftFile, String draftId) private voidhandleDeleteAttachment(HttpExchange exchange, Path userRoot, String draftId, String attachmentId) (package private) voidhandleMutation(HttpExchange exchange, String method, Path basePath, List<String> segments) Handles draft mutation requests.private voidhandleUpdate(HttpExchange exchange, Path draftFile, String draftId) private byte[]readDraftBytes(HttpExchange exchange) Reads draft content from the request, either as raw upload or JSON body.
-
Field Details
-
log
private static final org.apache.logging.log4j.Logger log -
handler
-
-
Constructor Details
-
StoreDraftOperations
StoreDraftOperations(StoreHandler handler)
-
-
Method Details
-
handleMutation
void handleMutation(HttpExchange exchange, String method, Path basePath, List<String> segments) throws IOException Handles draft mutation requests.- Throws:
IOException
-
handleCreate
- Throws:
IOException
-
handleUpdate
- Throws:
IOException
-
handleDelete
private void handleDelete(HttpExchange exchange, Path userRoot, Path draftFile, String draftId) throws IOException - Throws:
IOException
-
handleAddAttachment
private void handleAddAttachment(HttpExchange exchange, Path userRoot, String draftId) throws IOException - Throws:
IOException
-
handleDeleteAttachment
private void handleDeleteAttachment(HttpExchange exchange, Path userRoot, String draftId, String attachmentId) throws IOException - Throws:
IOException
-
readDraftBytes
Reads draft content from the request, either as raw upload or JSON body.- Throws:
IOException
-