[guardian-dev] Hi, i' new

Mark Murphy mmurphy at commonsware.com
Tue Nov 22 19:17:06 EST 2016


On Tue, Nov 22, 2016, at 19:12, arrase wrote:
> You mean something like:
> 
> public class PrivateDataProvider extends StreamProvider {
>   private static final String TAG="privatedata-path";
> 
>   @Override
>   protected StreamStrategy buildStrategy(Context context,
>                                          String tag, String name,
>                                          String path, boolean readOnly,
>                                          HashMap<String, String> attrs)
>     throws IOException {
>     if (TAG.equals(tag)) {
>       return(new LocalPathStrategy(name,
>         context.getDir(
>                 TorServiceConstants.DIRECTORY_TOR_DATA,
>                 Application.MODE_PRIVATE
>         ), readOnly));
>     }
> 
>     return(super.buildStrategy(context, tag, name, path, readOnly,
>     attrs));
>   }
> }
> 
> Then I will be able to use PrivateDataProvider instead of FileProvider.

Yes, though boolean readOnly is not yet released. That will be part of
v0.5.0, which I hope to release soon.  If you want to work with v0.4.4,
just skip that parameter for now.

I'll also look to add a built-in strategy for this, so you will not need
to create your own subclass.

-- 
Mark Murphy (a Commons Guy)
https://commonsware.com | https://github.com/commonsguy
https://commonsware.com/blog | https://twitter.com/commonsguy


More information about the guardian-dev mailing list