Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.74 KB | None | 0 0
  1. Uri uri = data.getData(); //I'm getting this in onActivityResult. The path is correct; this code hasn't changed between REST libraries and it's worked before
  2. parameterPairsMap.put(fileName, new File(URI.create(uri.toString())));
  3.  
  4. MultipartTypedOutput multipartTypedOutput = new MultipartTypedOutput();
  5. for(Map.Entry<String, Object> entry : pairs.entrySet()){
  6. if(entry.getValue() instanceof File){
  7. multipartTypedOutput.addPart(entry.getKey(), new TypedFile("*/*", (File)entry.getValue()));
  8. }
  9. else{
  10. multipartTypedOutput.addPart(entry.getKey(), new TypedString(entry.getValue().toString()));
  11. }
  12. }
  13.  
  14. restAdapter.create(RetrofitInterface.class).buildWithParameters(buildName, multipartTypedOutput, callbacks);
  15.  
  16. @POST("/job/{buildName}/buildWithParameters")
  17. void buildWithParameters(@Path("buildName") String buildName, @Body MultipartTypedOutput typedOutput, Callback<String> callbacks);
  18.  
  19. @Multipart
  20. @POST("/job/{buildName}/buildWithParameters")
  21. void buildWithParameters(@Path("buildName") String buildName, @Part("") MultipartTypedOutput typedOutput, Callback<String> callbacks);
  22.  
  23. W/System.err﹕ retrofit.RetrofitError: java.io.IOException: unexpected end of stream
  24. W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:421)
  25. W/System.err﹕ at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:264)
  26. W/System.err﹕ at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:315)
  27. W/System.err﹕ at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
  28. W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  29. W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  30. W/System.err﹕ at retrofit.Platform$Android$2$1.run(Platform.java:142)
  31. W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
  32. W/System.err﹕ Caused by: java.io.IOException: unexpected end of stream
  33. W/System.err﹕ at libcore.net.http.FixedLengthOutputStream.close(FixedLengthOutputStream.java:58)
  34. W/System.err﹕ at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
  35. W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
  36. W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
  37. W/System.err﹕ at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:71)
  38. W/System.err﹕ at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
  39. W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:358)
  40. W/System.err﹕ ... 7 more
  41.  
  42. D/Retrofit﹕ ---> HTTP POST /*edited*/
  43. D/Retrofit﹕ Authorization: Basic /*edited*/
  44. D/Retrofit﹕ Content-Type: multipart/form-data; boundary=5f8e6431-ed42-4d8b-95ce-d749f1797f04
  45. D/Retrofit﹕ Content-Length: 1090
  46. D/Retrofit﹕ --5f8e6431-ed42-4d8b-95ce-d749f1797f04
  47. Content-Disposition: form-data; name="branch"
  48. Content-Type: text/plain; charset=UTF-8
  49. Content-Length: 18
  50. Content-Transfer-Encoding: binary
  51. testingOneTwoTHree
  52. --5f8e6431-ed42-4d8b-95ce-d749f1797f04
  53. Content-Disposition: form-data; name="one.properties"; filename="local.properties"
  54. Content-Type: */*
  55. Content-Length: 449
  56. Content-Transfer-Encoding: binary
  57. ## This file is automatically generated by Android Studio.
  58. # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
  59. #
  60. # This file should *NOT* be checked into Version Control Systems,
  61. # as it contains information specific to your local configuration.
  62. #
  63. # Location of the SDK. This is only used by Gradle.
  64. # For customization when using a Version Control System, please read the
  65. # header note.
  66. sdk.dir=/Users/gimmiepepsi/Downloads/android-sdk-macosx
  67. --5f8e6431-ed42-4d8b-95ce-d749f1797f04
  68. Content-Disposition: form-data; name="isBoolean"
  69. Content-Type: text/plain; charset=UTF-8
  70. Content-Length: 4
  71. Content-Transfer-Encoding: binary
  72. true
  73. --5f8e6431-ed42-4d8b-95ce-d749f1797f04--
  74. D/Retrofit﹕ ---> END HTTP (1090-byte body)
  75. D/Retrofit﹕ ---- ERROR /* edited */
  76. D/Retrofit﹕ java.io.IOException: unexpected end of stream
  77. at libcore.net.http.FixedLengthOutputStream.close(FixedLengthOutputStream.java:58)
  78. at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
  79. at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
  80. at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
  81. at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:71)
  82. at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
  83. at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:358)
  84. at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:264)
  85. at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:315)
  86. at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
  87. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  88. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  89. at retrofit.Platform$Android$2$1.run(Platform.java:142)
  90. at java.lang.Thread.run(Thread.java:841)
  91. D/Retrofit﹕ ---- END ERROR
  92.  
  93. W/System.err﹕ retrofit.RetrofitError: java.io.IOException: unexpected end of stream
  94. W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:421)
  95. W/System.err﹕ at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:264)
  96. W/System.err﹕ at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:315)
  97. W/System.err﹕ at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
  98. W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  99. W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  100. W/System.err﹕ at retrofit.Platform$Android$2$1.run(Platform.java:142)
  101. W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
  102. W/System.err﹕ Caused by: java.io.IOException: unexpected end of stream
  103. W/System.err﹕ at libcore.net.http.FixedLengthOutputStream.close(FixedLengthOutputStream.java:58)
  104. W/System.err﹕ at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
  105. W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
  106. W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
  107. W/System.err﹕ at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:71)
  108. W/System.err﹕ at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
  109. W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:358)
  110. W/System.err﹕ ... 7 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement