Skip to content

Instantly share code, notes, and snippets.

@gregturn
Created October 19, 2015 16:07
Show Gist options
  • Select an option

  • Save gregturn/5baf2cbc3c112746f38f to your computer and use it in GitHub Desktop.

Select an option

Save gregturn/5baf2cbc3c112746f38f to your computer and use it in GitHub Desktop.
What is REALLY takes to feed authorization through Groovy.
URL url = path.toURL()
URLConnection urlConnection = url.openConnection()
if (url.userInfo != null) {
urlConnection.setRequestProperty(HttpHeaders.AUTHORIZATION, "Basic ${new Base64().encode(url.userInfo.bytes)}")
}
client.uploadApplication(description.application, description.targetPackage.package, urlConnection.inputStream)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment