Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- parameterPairsMap.put(fileName, new File(URI.create(uri.toString())));
- MultipartTypedOutput multipartTypedOutput = new MultipartTypedOutput();
- for(Map.Entry<String, Object> entry : pairs.entrySet()){
- if(entry.getValue() instanceof File){
- multipartTypedOutput.addPart(entry.getKey(), new TypedFile("*/*", (File)entry.getValue()));
- }
- else{
- multipartTypedOutput.addPart(entry.getKey(), new TypedString(entry.getValue().toString()));
- }
- }
- restAdapter.create(RetrofitInterface.class).buildWithParameters(buildName, multipartTypedOutput, callbacks);
- @POST("/job/{buildName}/buildWithParameters")
- void buildWithParameters(@Path("buildName") String buildName, @Body MultipartTypedOutput typedOutput, Callback<String> callbacks);
- @Multipart
- @POST("/job/{buildName}/buildWithParameters")
- void buildWithParameters(@Path("buildName") String buildName, @Part("") MultipartTypedOutput typedOutput, Callback<String> callbacks);
- W/System.err﹕ retrofit.RetrofitError: java.io.IOException: unexpected end of stream
- W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:421)
- W/System.err﹕ at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:264)
- W/System.err﹕ at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:315)
- W/System.err﹕ at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
- W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
- W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
- W/System.err﹕ at retrofit.Platform$Android$2$1.run(Platform.java:142)
- W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
- W/System.err﹕ Caused by: java.io.IOException: unexpected end of stream
- W/System.err﹕ at libcore.net.http.FixedLengthOutputStream.close(FixedLengthOutputStream.java:58)
- W/System.err﹕ at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
- W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
- W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
- W/System.err﹕ at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:71)
- W/System.err﹕ at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
- W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:358)
- W/System.err﹕ ... 7 more
- D/Retrofit﹕ ---> HTTP POST /*edited*/
- D/Retrofit﹕ Authorization: Basic /*edited*/
- D/Retrofit﹕ Content-Type: multipart/form-data; boundary=5f8e6431-ed42-4d8b-95ce-d749f1797f04
- D/Retrofit﹕ Content-Length: 1090
- D/Retrofit﹕ --5f8e6431-ed42-4d8b-95ce-d749f1797f04
- Content-Disposition: form-data; name="branch"
- Content-Type: text/plain; charset=UTF-8
- Content-Length: 18
- Content-Transfer-Encoding: binary
- testingOneTwoTHree
- --5f8e6431-ed42-4d8b-95ce-d749f1797f04
- Content-Disposition: form-data; name="one.properties"; filename="local.properties"
- Content-Type: */*
- Content-Length: 449
- Content-Transfer-Encoding: binary
- ## This file is automatically generated by Android Studio.
- # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
- #
- # This file should *NOT* be checked into Version Control Systems,
- # as it contains information specific to your local configuration.
- #
- # Location of the SDK. This is only used by Gradle.
- # For customization when using a Version Control System, please read the
- # header note.
- sdk.dir=/Users/gimmiepepsi/Downloads/android-sdk-macosx
- --5f8e6431-ed42-4d8b-95ce-d749f1797f04
- Content-Disposition: form-data; name="isBoolean"
- Content-Type: text/plain; charset=UTF-8
- Content-Length: 4
- Content-Transfer-Encoding: binary
- true
- --5f8e6431-ed42-4d8b-95ce-d749f1797f04--
- D/Retrofit﹕ ---> END HTTP (1090-byte body)
- D/Retrofit﹕ ---- ERROR /* edited */
- D/Retrofit﹕ java.io.IOException: unexpected end of stream
- at libcore.net.http.FixedLengthOutputStream.close(FixedLengthOutputStream.java:58)
- at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
- at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
- at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
- at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:71)
- at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
- at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:358)
- at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:264)
- at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:315)
- at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
- at retrofit.Platform$Android$2$1.run(Platform.java:142)
- at java.lang.Thread.run(Thread.java:841)
- D/Retrofit﹕ ---- END ERROR
- W/System.err﹕ retrofit.RetrofitError: java.io.IOException: unexpected end of stream
- W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:421)
- W/System.err﹕ at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:264)
- W/System.err﹕ at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:315)
- W/System.err﹕ at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
- W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
- W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
- W/System.err﹕ at retrofit.Platform$Android$2$1.run(Platform.java:142)
- W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
- W/System.err﹕ Caused by: java.io.IOException: unexpected end of stream
- W/System.err﹕ at libcore.net.http.FixedLengthOutputStream.close(FixedLengthOutputStream.java:58)
- W/System.err﹕ at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
- W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
- W/System.err﹕ at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
- W/System.err﹕ at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:71)
- W/System.err﹕ at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
- W/System.err﹕ at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:358)
- W/System.err﹕ ... 7 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement