YunkuJavaSDK/src/main/java/com/yunkuent/sdk/MsMultiPartFormData.java
public String finish() {
        List<String> response = new ArrayList<String>();

        writer.append(LINE_FEED).flush();
        writer.append("--" + boundary + "--").append(LINE_FEED);
        writer.close();

        int code = 0;
        String result = "";
        BufferedReader reader = null;
        try {
            code = httpConn.getResponseCode();
            reader = new BufferedReader(new InputStreamReader(
                    httpConn.getInputStream()));
            String line = null;
            while ((line = reader.readLine()) != null) {
                response.add(line);
            }
            reader.close();

        } catch (IOException e) {
            try {
                code = httpConn.getResponseCode();
                reader = new BufferedReader(new InputStreamReader(httpConn.getErrorStream()));
                String line = null;
                while ((line = reader.readLine()) != null) {
                    response.add(line);
                }
                reader.close();
            } catch (IOException e1) {
                e1.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            }
        } finally {
            httpConn.disconnect();
        }


        for (String str : response) {
            result += str;
        }
        ReturnResult returnResult = new ReturnResult(result, code);
        Gson gosn = new Gson();
        LogPrint.info(TAG, "createFile:finish");
        return gosn.toJson(returnResult);
    }
/**
     * Completes the request and receives response from the server.
     *
     * @return a list of Strings as response in case the server returned
     * status OK, otherwise an exception is thrown.
     */
Completes the request and receives response from the server.
@return a list of Strings as response in case the server returned
status OK, otherwise an exception is thrown.
Completes the request and receives response from the server . @return a list of Strings as response in case the server returned status OK otherwise an exception is thrown .
public String finish() {
        List<String> response = new ArrayList<String>();
        writer.append(LINE_FEED).flush();
        writer.append("--" + boundary + "--").append(LINE_FEED);
        writer.close();
        int code = 0;
        String result = "";
        BufferedReader reader = null;
        try {
            code = httpConn.getResponseCode();
            reader = new BufferedReader(new InputStreamReader(
                    httpConn.getInputStream()));
            String line = null;
            while ((line = reader.readLine()) != null) {
                response.add(line);
            }
            reader.close();
        } catch (IOException e) {
            try {
                code = httpConn.getResponseCode();
                reader = new BufferedReader(new InputStreamReader(httpConn.getErrorStream()));
                String line = null;
                while ((line = reader.readLine()) != null) {
                    response.add(line);
                }
                reader.close();
            } catch (IOException e1) {
                e1.printStackTrace();  
            }
        } finally {
            httpConn.disconnect();
        }
        for (String str : response) {
            result += str;
        }
        ReturnResult returnResult = new ReturnResult(result, code);
        Gson gosn = new Gson();
        LogPrint.info(TAG, "createFile:finish");
        return gosn.toJson(returnResult);
    }
public String finish ( ) { List < String > response = new ArrayList < String > ( ) ; writer . append ( LINE_FEED ) . flush ( ) ; writer . append ( "--" + boundary + "--" ) . append ( LINE_FEED ) ; writer . close ( ) ; int code = 0 ; String result = "" ; BufferedReader reader = null ; try { code = httpConn . getResponseCode ( ) ; reader = new BufferedReader ( new InputStreamReader ( httpConn . getInputStream ( ) ) ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { response . add ( line ) ; } reader . close ( ) ; } catch ( IOException e ) { try { code = httpConn . getResponseCode ( ) ; reader = new BufferedReader ( new InputStreamReader ( httpConn . getErrorStream ( ) ) ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { response . add ( line ) ; } reader . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } } finally { httpConn . disconnect ( ) ; } for ( String str : response ) { result += str ; } ReturnResult returnResult = new ReturnResult ( result , code ) ; Gson gosn = new Gson ( ) ; LogPrint . info ( TAG , "createFile:finish" ) ; return gosn . toJson ( returnResult ) ; }
Completes the request and receives response from the server.
Completes the request and receives response from the server .
//To change body of catch statement use File | Settings | File Templates.