private void uploadSkinFile(String url) throws Exception {
        CloseableHttpClient httpclient = HttpClients.createDefault();
        try {
            HttpPost httppost = new HttpPost(url);

            FileBody skin = new FileBody(skinFile);
            StringBody user = new StringBody(this.username, ContentType.TEXT_PLAIN);
            StringBody session = new StringBody(this.session, ContentType.TEXT_PLAIN);

            HttpEntity reqEntity = MultipartEntityBuilder.create()
                    .addPart("skinfile", skin)
                    .addPart("user", user)
                    .addPart("sessionId", session)
                    .build();


            httppost.setEntity(reqEntity);

            System.out.println("executing request " + httppost.getRequestLine());
            CloseableHttpResponse response = httpclient.execute(httppost);
            try {
                System.out.println(response.getStatusLine());
                HttpEntity resEntity = response.getEntity();
                if (resEntity != null) {
                    String resString = EntityUtils.toString(resEntity);
                    if (resString.equals("OK")) {
                        publish(new SkinUploadState(true));
                    } else {
                        System.err.println("[Skin Upload Error] " + resString);
                        publish(new SkinUploadState(false));
                    }
                }
                
                EntityUtils.consume(resEntity);
            } finally {
                response.close();
            }
        } finally {
            httpclient.close();
        }
    }