Skip to content

Commit

Permalink
Make a request from bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Oct 20, 2023
1 parent 43daee1 commit a24ee3e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package uk.ac.manchester.spinnaker.alloc.model;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.isNull;

import java.net.URI;
Expand Down Expand Up @@ -281,4 +282,12 @@ public void setOriginalRequest(byte[] originalRequest) {
public Optional<byte[]> getOriginalRequest() {
return Optional.ofNullable(originalRequest);
}

/** @return the original request as a string */
public String getRequest() {
if (originalRequest == null) {
return "";
}
return new String(originalRequest, UTF_8);
}
}

0 comments on commit a24ee3e

Please sign in to comment.