public boolean putContent(String url, String file) throws MalformedURLException {
        URL u = createURL(url);
        URLConnection connection = createConnection(u);

        if(connection == null) return false;

        InputStream in;

        try {
            in = connection.getInputStream();
        } catch (IOException e) {
            e.printStackTrace();
            return false;
        }

        File f = new File(file);
        try {
            if(f.createNewFile())
                System.out.println("Create file: " + f.getName());
        } catch (IOException e) {
            e.printStackTrace();
        }

        FileOutputStream out;
        try {
            out = new FileOutputStream(f);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return false;
        }

        byte[] buffer = new byte[1024];
        int bytes;

        try{
            while((bytes = in.read(buffer)) != -1){
                out.write(buffer, 0, bytes);
            }
        }
        catch (IOException e){
            e.printStackTrace();
            return false;
        }

        try {
            in.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return true;
    }