0
            } 
 
            URL url = new URL(createFileUrl);
 
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("User-Agent", "GPSLogger for Android");
            conn.setRequestProperty("Authorization", "Bearer " + authToken);
            conn.setRequestProperty("Content-Type", "application/json");
 
            conn.setUseCaches(false);
            conn.setDoInput(true);
            conn.setDoOutput(true);
 
            DataOutputStream wr = new DataOutputStream(
                    conn.getOutputStream());
            wr.writeBytes(createFilePayload);
            wr.flush();
            wr.close();
 
            fileId = null;
 
            String fileMetadata = Utilities.GetStringFromInputStream(conn.getInputStream());
 
            JSONObject fileMetadataJson = new JSONObject(fileMetadata);
            fileId = fileMetadataJson.getString("id");
            Utilities.LogDebug("File created with ID " + fileId);
 
        } 
        catch (Exception e)
        { 
 
            System.out.println(e.getMessage());
            System.out.println(e.getMessage());
        } 
        finally 
        { 
            if (conn != null)
            { 
                conn.disconnect();
            } 
 
        } 
 
        return fileId;
Contextual code suggestions in your IDE  Get Codota for Java