GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/330

    TypeCoerce string to byte[]

    An alternative impl would have been to treat the given string as base64 
encoded. But I don't think that is what people would expect as the default. 
However, by using a simple `string.getBytes()` there are two downsides:
    * can't pass in some byte array values, e.g. in UI effector parameter 
(would require base64 for that)
    * it's using the default of the JVM (e.g. rather than explicitly using 
UTF-8)
    
    I think that's good enough though - thoughts?
    
    My use-case is in a test case I wrote for a HTTP client entity, where an 
effector takes a parameter of type `byte[]` and uses that as the payload of a 
POST request. The most common situation I think is where one wants to just pass 
a "normal" string body.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server 
typeCoercions-string-to-byte-array

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/330.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #330
    
----
commit 79e35a486b9aff44b0f9dfe0b5c3b4a336ef33bd
Author: Aled Sage <aled.s...@gmail.com>
Date:   2016-09-16T12:01:24Z

    TypeCoerce string to byte[]

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to