【翻译】(56)path-permission元素

【翻译】(56)path-permission元素

 

see

http://developer.android.com/guide/topics/manifest/path-permission-element.html

 

原文见

http://developer.android.com/guide/topics/manifest/path-permission-element.html

 

-------------------------------

 

<path-permission>

 

path-permission元素

 

-------------------------------

 

* syntax:

 

* 语法:

 

-------------------------------

 

<path-permission android:path="string"

                 android:pathPrefix="string"

                 android:pathPattern="string"

                 android:permission="string"

                 android:readPermission="string"

                 android:writePermission="string" />

 

-------------------------------

 

* contained in:

 

* 被包含在:

 

<provider>

 

* description:

 

* 描述:

 

Defines the path and required permissions for a specific subset of data within a content provider. This element can be specified multiple times to supply multiple paths.

 

定义在一个内容提供者中特定数据子集的路径和所需的权限。这个元素可以被指定多次以提供多个路径。

 

* attributes:

 

* 属性:

 

* android:path

 

A complete URI path for a subset of content provider data. Permission can be granted only to the particular data identified by this path. When used to provide search suggestion content, it must be appended with "/search_suggest_query".

 

内容提供者数据的子集的完整URI路径。权限可以被授权只对应被这个路径标识的特殊数据。当用于提供搜索建议的内容时,它必须用"/search_suggest_query"尾加。

 

* android:pathPrefix

 

The initial part of a URI path for a subset of content provider data. Permission can be granted to all data subsets with paths that share this initial part.

 

用于内容提供者数据的子集的URI的开头部分。权限可以被授权给所有带有共享此开头部分的路径的数据子集。

 

* android:pathPattern

 

A complete URI path for a subset of content provider data, but one that can use the following wildcards:

 

用于内容提供者数据的子集的完整URI路径,但它可以使用以下通配符:

 

* An asterisk ('*'). This matches a sequence of 0 to many occurrences of the immediately preceding character.

 

* 一个星号('*')匹配一个零到多次出现的即时(注:紧接)前驱字符的序列。

 

* A period followed by an asterisk (".*"). This matches any sequence of 0 or more characters.

 

* 一个点后面跟着一个星号(".*")匹配0到多个字符的任意序列。

 

Because '\' is used as an escape character when the string is read from XML (before it is parsed as a pattern), you will need to double-escape. For example, a literal '*' would be written as "\\*" and a literal '\' would be written as "\\". This is basically the same as what you would need to write if constructing the string in Java code.

 

因为'\'被用作一个转义字符当该字符串从XML中被读取(在它被解释为一个模式之前),你将需要双转义:例如,一个字面'*'应该被写成"\\*"而一个字面'\'应该被写成"\\\\"。这基本上和如果在Java代码中构造字符串的话你需要写的东西是相同的。

 

For more information on these types of patterns, see the descriptions of PATTERN_LITERAL, PATTERN_PREFIX, and PATTERN_SIMPLE_GLOB in the PatternMatcher class.

 

想获得关于这三种类型模式的更多信息,参见PatternMatcher类中PATTERN_LITERAL,PATTERN_PREFIX,和PATTERN_SIMPLE_GLOB的描述。

 

* android:permission

 

The name of a permission that clients must have in order to read or write the content provider's data. This attribute is a convenient way of setting a single permission for both reading and writing. However, the readPermission and writePermission attributes take precedence over this one.

 

权限的名称,客户端必须拥有该权限以便读取或写入内容提供者的数据。这个属性是设置单一权限用于读写的便利方法。然而,readPermission和writePermission属性持有比它高的优先级。

 

* android:readPermission

 

A permission that clients must have in order to query the content provider.

 

客户端必须拥有的权限以便查询内容提供者。

 

* android:writePermission

 

A permission that clients must have in order to make changes to the data controlled by the content provider.

 

客户端必须拥有的权限以便对内容提供者控制的数据作出改变。

 

* introduced in:

 

* 引入:

 

API Level 4

 

API级别4

 

* see also:

 

* 另见:

 

SearchManager

Manifest.permission

Security and Permissions 安全与权限

 

Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.

 

除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。

 

Android 4.0 r1 - 10 Feb 2012 0:44

 

-------------------------------

 

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

 

(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)

 

(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:

* ソフトウェア技術ドキュメントを勝手に翻訳

http://www.techdoctranslator.com/android

* Ley's Blog

http://leybreeze.com/blog/

* 农民伯伯

http://www.cnblogs.com/over140/

* Android中文翻译组

http://androidbox.sinaapp.com/


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值