Skip to content

Commit

Permalink
Renamed element to base64 binary
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Dec 5, 2024
1 parent 53a2b8d commit 32f7d5c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@
*/
public interface IValidationSourceRestorer
{
/**
* Restore a validation source
*
* @param sValidationSourceTypeID
* The validation source type ID. Must be non-<code>null</code> to be
* able to restore something.
* @param sSystemID
* The system ID of the validation source. May be <code>null</code>.
* @param bIsPartialSource
* <code>true</code> if it is a partial source, <code>false</code> if
* it is complete.
* @param aPayloadBytes
* The payload bytes to restore the source from. Must be
* non-<code>null</code> to be able to restore something.
* @return <code>null</code> if restore failed
*/
@Nullable
IValidationSource restoreValidationSource (@Nullable String sValidationSourceTypeID,
@Nullable String sSystemID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public final class PhiveJsonHelper
public static final String JSON_SOURCE_TYPE_ID = "sourceTypeID";
public static final String JSON_SYSTEM_ID = "systemID";
public static final String JSON_PARTIAL_SOURCE = "partialSource";
public static final String JSON_PAYLOAD = "payload";
public static final String JSON_PAYLOAD_BASE64 = "payloadBase64";

public static final String JSON_VESID = "vesid";
public static final String JSON_NAME = "name";
Expand Down Expand Up @@ -514,7 +514,7 @@ public static IJsonObject getJsonValidationSource (@Nonnull final IValidationSou
{
aSource.writeTo (aB64OS);
aB64OS.flushBase64 ();
ret.add (JSON_PAYLOAD, aBAOS.getAsString (StandardCharsets.ISO_8859_1));
ret.add (JSON_PAYLOAD_BASE64, aBAOS.getAsString (StandardCharsets.ISO_8859_1));
}
catch (final IOException ex)
{
Expand Down Expand Up @@ -790,7 +790,7 @@ public static ValidationResultList getAsValidationResultList (@Nullable final IJ
final IJsonObject aJsonVS = aJson.getAsObject (PhiveJsonHelper.JSON_VALIDATION_SOURCE);
if (aJsonVS != null)
{
final String sBase64EncodedPayload = aJsonVS.getAsString (PhiveJsonHelper.JSON_PAYLOAD);
final String sBase64EncodedPayload = aJsonVS.getAsString (PhiveJsonHelper.JSON_PAYLOAD_BASE64);
final byte [] aPayloadBytes = Base64.safeDecode (sBase64EncodedPayload);
if (aPayloadBytes == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public final class PhiveXMLHelper
public static final String XML_SOURCE_TYPE_ID = "sourceTypeID";
public static final String XML_SYSTEM_ID = "systemID";
public static final String XML_PARTIAL_SOURCE = "partialSource";
public static final String XML_PAYLOAD = "payload";
public static final String XML_PAYLOAD_BASE64 = "payloadBase64";

public static final String XML_VESID = "vesid";
public static final String XML_NAME = "name";
Expand Down Expand Up @@ -439,7 +439,7 @@ public static IMicroElement getXMLValidationSource (@Nonnull final IValidationSo
{
aSource.writeTo (aB64OS);
aB64OS.flushBase64 ();
ret.appendElement (XML_PAYLOAD).appendText (aBAOS.getAsString (StandardCharsets.ISO_8859_1));
ret.appendElement (XML_PAYLOAD_BASE64).appendText (aBAOS.getAsString (StandardCharsets.ISO_8859_1));
}
catch (final IOException ex)
{
Expand Down Expand Up @@ -709,7 +709,7 @@ public static ValidationResultList getAsValidationResultList (@Nullable final IM
final IMicroElement eVS = aXML.getFirstChildElement (XML_VALIDATION_SOURCE);
if (eVS != null)
{
final String sBase64EncodedPayload = MicroHelper.getChildTextContentTrimmed (eVS, XML_PAYLOAD);
final String sBase64EncodedPayload = MicroHelper.getChildTextContentTrimmed (eVS, XML_PAYLOAD_BASE64);
final byte [] aPayloadBytes = Base64.safeDecode (sBase64EncodedPayload);
if (aPayloadBytes == null)
{
Expand Down

0 comments on commit 32f7d5c

Please sign in to comment.