mirror of https://github.com/kurisufriend/Clover
parent
6e9e7f9659
commit
8d53bd762c
@ -0,0 +1,36 @@ |
||||
/* |
||||
* Clover - 4chan browser https://github.com/Floens/Clover/
|
||||
* Copyright (C) 2014 Floens |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/ |
||||
package org.floens.chan.core.cache; |
||||
|
||||
import android.content.Context; |
||||
import android.net.Uri; |
||||
import android.support.v4.content.FileProvider; |
||||
|
||||
import org.floens.chan.utils.AndroidUtils; |
||||
|
||||
import java.io.File; |
||||
|
||||
public class FileCacheProvider { |
||||
// Same as the one defined in the manifest.
|
||||
private static final String AUTHORITY = "org.floens.chan.fileprovider"; |
||||
|
||||
public static Uri getUriForFile(File file) { |
||||
Context applicationContext = AndroidUtils.getAppContext(); |
||||
return FileProvider.getUriForFile(applicationContext, AUTHORITY, file); |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<paths> |
||||
|
||||
<!-- Corresponds to the file path chosen in the NetModule.getCacheDir method --> |
||||
<cache-path |
||||
name="fc" |
||||
path="filecache/" /> |
||||
<external-cache-path |
||||
name="exfc" |
||||
path="filecache/" /> |
||||
|
||||
</paths> |
Loading…
Reference in new issue