Skip to content

Commit 398a589

Browse files
jreckAndroid (Google) Code Review
authored andcommitted
Merge "DO NOT MERGE - Create db path if it doesn't exit" into gingerbread
2 parents dc54a8c + bf8af78 commit 398a589

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

core/java/android/webkit/WebIconDatabase.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.provider.Browser;
2525
import android.util.Log;
2626

27+
import java.io.File;
2728
import java.util.HashMap;
2829
import java.util.Vector;
2930

@@ -194,13 +195,16 @@ public interface IconListener {
194195
/**
195196
* Open a the icon database and store the icons in the given path.
196197
* @param path The directory path where the icon database will be stored.
197-
* @return True if the database was successfully opened or created in
198-
* the given path.
199198
*/
200199
public void open(String path) {
201200
if (path != null) {
201+
// Make the directories and parents if they don't exist
202+
File db = new File(path);
203+
if (!db.exists()) {
204+
db.mkdirs();
205+
}
202206
mEventHandler.postMessage(
203-
Message.obtain(null, EventHandler.OPEN, path));
207+
Message.obtain(null, EventHandler.OPEN, db.getAbsolutePath()));
204208
}
205209
}
206210

0 commit comments

Comments
 (0)