OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package org.chromium.chromeview.base; | |
6 | |
7 import android.content.Context; | |
8 import android.os.Environment; | |
9 | |
10 import org.chromium.chromeview.base.CalledByNative; | |
11 | |
12 import java.io.File; | |
13 | |
14 /** | |
15 * This class provides the path related methods for the native library. | |
16 */ | |
17 class PathUtils { | |
18 | |
19 /** | |
20 * @return the private directory that used to store application data. | |
21 */ | |
22 @CalledByNative | |
23 public static String getDataDirectory(Context appContext) { | |
24 return appContext.getDir("chrome", Context.MODE_PRIVATE).getPath(); | |
joth
2012/02/23 14:07:14
base/ should not know about "chrome"
at least, th
Peter Beverloo
2012/02/23 14:39:21
Added a TODO and filed an issue downstream, as it
| |
25 } | |
26 | |
27 /** | |
28 * @return the cache directory. | |
29 */ | |
30 @CalledByNative | |
31 public static String getCacheDirectory(Context appContext) { | |
32 return appContext.getCacheDir().getPath(); | |
33 } | |
34 | |
35 /** | |
36 * @return the public downloads directory. | |
37 */ | |
38 @CalledByNative | |
39 public static String getDownloadsDirectory(Context appContext) { | |
40 return Environment.getExternalStoragePublicDirectory( | |
41 Environment.DIRECTORY_DOWNLOADS).getPath(); | |
42 } | |
43 } | |
OLD | NEW |