Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions src/com/androidquery/util/AQUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,28 @@ public static void cleanCache(File cacheDir, long triggerSize, long targetSize){
}
}

private static File tempDir;

public static File getTempDir(){
File ext = Environment.getExternalStorageDirectory();
File tempDir = new File(ext, "aquery/temp");
tempDir.mkdirs();
if(!tempDir.exists()){
return null;

if(tempDir == null){
File ext = Environment.getExternalStorageDirectory();
tempDir = new File(ext, "aquery/temp");
tempDir.mkdirs();
if(!tempDir.exists()){
return null;
}
}

return tempDir;

}

public static void setTempDir(File dir){
tempDir = dir;
if(tempDir != null){
tempDir.mkdirs();
}
}

private static boolean testCleanNeeded(File[] files, long triggerSize){
Expand Down