mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
Removed accidently added remote thumbnail generation.
This commit is contained in:
parent
2e5d99463d
commit
3ace32e9ae
1 changed files with 26 additions and 26 deletions
|
@ -187,32 +187,32 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
|
|||
} else {
|
||||
// Download thumbnail from server
|
||||
// Commented out as maybe changes to client library are needed
|
||||
DefaultHttpClient httpclient = new DefaultHttpClient();
|
||||
try {
|
||||
httpclient.getCredentialsProvider().setCredentials(
|
||||
new AuthScope(mClient.getBaseUri().toString().replace("https://", ""), 443),
|
||||
new UsernamePasswordCredentials(mClient.getCredentials().getUsername(), mClient.getCredentials().getAuthToken()));
|
||||
|
||||
|
||||
HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?x=50&y=50&path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8"));
|
||||
HttpResponse response = httpclient.execute(httpget);
|
||||
HttpEntity entity = response.getEntity();
|
||||
|
||||
if (entity != null) {
|
||||
byte[] bytes = EntityUtils.toByteArray(entity);
|
||||
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
||||
thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
|
||||
|
||||
// Add thumbnail to cache
|
||||
if (thumbnail != null){
|
||||
addBitmapToCache(imageKey, thumbnail);
|
||||
}
|
||||
}
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
}
|
||||
// DefaultHttpClient httpclient = new DefaultHttpClient();
|
||||
// try {
|
||||
// httpclient.getCredentialsProvider().setCredentials(
|
||||
// new AuthScope(mClient.getBaseUri().toString().replace("https://", ""), 443),
|
||||
// new UsernamePasswordCredentials(mClient.getCredentials().getUsername(), mClient.getCredentials().getAuthToken()));
|
||||
//
|
||||
//
|
||||
// HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?x=50&y=50&path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8"));
|
||||
// HttpResponse response = httpclient.execute(httpget);
|
||||
// HttpEntity entity = response.getEntity();
|
||||
//
|
||||
// if (entity != null) {
|
||||
// byte[] bytes = EntityUtils.toByteArray(entity);
|
||||
// Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
||||
// thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
|
||||
//
|
||||
// // Add thumbnail to cache
|
||||
// if (thumbnail != null){
|
||||
// addBitmapToCache(imageKey, thumbnail);
|
||||
// }
|
||||
// }
|
||||
// } catch(Exception e){
|
||||
// e.printStackTrace();
|
||||
// }finally {
|
||||
// httpclient.getConnectionManager().shutdown();
|
||||
// }
|
||||
}
|
||||
}
|
||||
return thumbnail;
|
||||
|
|
Loading…
Reference in a new issue