(Drive drive)
| 168 | } |
| 169 | |
| 170 | private boolean login(Drive drive) { |
| 171 | try { |
| 172 | JSONObject params = new JSONObject(); |
| 173 | params.put("username", drive.getLogin().getUsername()); |
| 174 | params.put("password", drive.getLogin().getPassword()); |
| 175 | String response = OkHttp.post(drive.loginApi(), params.toString()); |
| 176 | drive.setToken(new JSONObject(response).getJSONObject("data").getString("token")); |
| 177 | return true; |
| 178 | } catch (Exception e) { |
| 179 | e.printStackTrace(); |
| 180 | return false; |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | private Item getDetail(String id) { |
| 185 | try { |
no test coverage detected