File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
sample/src/main/java/com/loopj/android/http/sample Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1
1
package com .loopj .android .http .sample ;
2
2
3
3
import android .util .Log ;
4
+
4
5
import com .loopj .android .http .AsyncHttpResponseHandler ;
5
6
import com .loopj .android .http .ResponseHandlerInterface ;
6
- import static com .loopj .android .http .sample .SampleParentActivity .LIGHTGREEN ;
7
- import java .io .File ;
8
7
9
8
import org .apache .http .Header ;
10
9
10
+ import java .io .File ;
11
+
11
12
public class UsePoolThreadSample extends GetSample {
12
13
13
14
private static final String LOG_TAG = "UsePoolThreadSample" ;
@@ -95,20 +96,17 @@ public void run() {
95
96
}
96
97
97
98
private File getRandomCacheFile () {
98
- File dir = getExternalCacheDir ();
99
- if (dir == null ) {
100
- dir = getCacheDir ();
101
- if (dir == null ) {
102
- dir = getFilesDir ();
103
- }
99
+ File dir = getCacheDir ();
100
+ if (dir == null ) {
101
+ dir = getFilesDir ();
104
102
}
105
103
106
104
return new File (dir , "sample-" + System .currentTimeMillis () + ".bin" );
107
105
}
108
106
109
107
private void saveBytesOnDisk (File destination , byte [] bytes ) {
110
108
// TODO: Spin your own implementation to save the bytes on disk/SD card.
111
- if (bytes != null && destination != null ) {
109
+ if (bytes != null && destination != null ) {
112
110
Log .d (LOG_TAG , "Saved " + bytes .length + " bytes into file: " + destination .getAbsolutePath ());
113
111
}
114
112
}
You can’t perform that action at this time.
0 commit comments