-// DefaultHttpClient httpclient = new DefaultHttpClient();\r
-// try {\r
-// httpclient.getCredentialsProvider().setCredentials(\r
-// new AuthScope(mClient.getBaseUri().toString().replace("https://", ""), 443), \r
-// new UsernamePasswordCredentials(mClient.getCredentials().getUsername(), mClient.getCredentials().getAuthToken()));\r
-// \r
-//\r
-// HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?x=50&y=50&path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8"));\r
-// HttpResponse response = httpclient.execute(httpget);\r
-// HttpEntity entity = response.getEntity();\r
-// \r
-// if (entity != null) {\r
-// byte[] bytes = EntityUtils.toByteArray(entity);\r
-// Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);\r
-// thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
-// \r
-// // Add thumbnail to cache\r
-// if (thumbnail != null){\r
-// addBitmapToCache(imageKey, thumbnail);\r
-// }\r
-// }\r
-// } catch(Exception e){\r
-// e.printStackTrace();\r
-// }finally {\r
-// httpclient.getConnectionManager().shutdown();\r
-// }\r
+ try {\r
+ int status = -1;\r
+ \r
+ String uri = client.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/100/100"+URLEncoder.encode(file.getRemotePath(), "UTF-8");\r
+ Log_OC.d("Thumbnail", "URI: " + uri);\r
+ GetMethod get = new GetMethod(uri);\r
+ status = client.executeMethod(get);\r
+ if(isSuccess(status)) {\r
+ byte[] bytes = get.getResponseBody();\r
+ Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);\r
+ thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
+ \r
+ // Add thumbnail to cache\r
+ if (thumbnail != null){\r
+ addBitmapToCache(imageKey, thumbnail);\r
+ }\r
+ }\r
+ } catch(Exception e){\r
+ e.printStackTrace();\r
+ }\r