我一直在尝试按照Android教程共享文件.我这样设置FileProvider
:
在主清单xml上:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.mysecondapp.fileprovider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
Run Code Online (Sandbox Code Playgroud)
res/xml/filpaths.xml文件:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="myexternalimages" path="SpCars_album/" />
</paths>
Run Code Online (Sandbox Code Playgroud)
在我的代码中,我尝试以下方法:
File requestFile = new File(mImageFilenames[position]);
try {
fileUri = FileProvider.getUriForFile(
SeventhActivity.this,
"com.example.mysecondapp.fileprovider",
requestFile);
} catch (IllegalArgumentException e) {
Log.e("File Selector",
"The selected file can't be shared: " +
mImageFilenames[position]);
}
Run Code Online (Sandbox Code Playgroud)
requestFile使用适当的文件工作路径进行实例化.该文件的路径完全以getExternalFilesDir(Environment.DIRECTORY_PICTURES)
返回的内容开始.我只是无法理解是什么引起了错误,因为一切似乎都适合.提前致谢.
android filepath illegalargumentexception android-fileprovider
我想实现自定义逻辑来确定我的 Pod 的准备情况,我回顾了这一点: https: //docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.kubernetes -probes.external-state他们提到了一个示例属性:
management.endpoint.health.group.readiness.include=readinessState,customCheck
问题是 - 我如何覆盖customCheck
?就我而言,我想使用 HTTP 探针,因此 yaml 如下所示:
readinessProbe:
initialDelaySeconds: 10
periodSeconds: 10
httpGet:
path: /actuator/health
port: 12345
Run Code Online (Sandbox Code Playgroud)
那么话又说回来 - 我应该在哪里以及如何应用逻辑来确定应用程序何时准备就绪(就像上面的链接一样,我想依赖外部服务才能使其准备就绪)