Log.e("sgx", "pathname 不可为空字符串") return "" } val file = File(appContext.filesDir, pathname) if (!file.exists()) { Log.e("sgx", "文件不存在") return "" } if (file.isDirectory) { Log.e("sgx", "文件是目录,无法读取文本") return "" } return file.readText() } /*...
当一个函数的参数比较多时,那么在调用时想要传递参数就比较蛋疼,特别是还有相同类型的参数的时候,一片混乱,比如: funlog(tag:String,event:String,source:String,amount:Int,price:Float,persist:Boolean):Unit{println("$tag,$event,$amount$price")if(persist){// write to file}}log("func","Function argum...
val preJavaKotlinOutput = project.files(project.provider { mutableListOf<File>.apply { add(kotlinTask.get.destinationDirectory.get.asFile) if(Kapt3GradleSubplugin.isEnabled(project)) { // Add Kapt3 output as well, since there's no SyncOutputTask with the new API val kaptClasssesDir = Kap...
KT-58992 Analysis API: move org.jetbrains.kotlin.analysis.api.fir.utils.addImportToFile out of Analysis API KT-58727 K2: AA FIR: implicit type in delegated function treated as error KT-58653 K2: Analysis API: add functions for KtScope members access by name KT-57559 K2 IDE: KotlinException...
KT-58992 Analysis API: move org.jetbrains.kotlin.analysis.api.fir.utils.addImportToFile out of Analysis API KT-58727 K2: AA FIR: implicit type in delegated function treated as error KT-58653 K2: Analysis API: add functions for KtScope members access by name KT-57559 K2 IDE: KotlinException...
NetDiscover是一款基于Vert.x、RxJava2实现的爬虫框架。我最近添加了两个模块:Selenium模块、DSL模块。 一. Selenium模块 添加这个模块的目的是为了让它能够模拟人的行为去操作浏览器,完成爬虫抓取的目的。 Selenium是一个用于Web应用程序测试的工具。Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。支持的浏览...
importkotlinx.android.synthetic.main.activity_main.*classMainActivity:AppCompatActivity(){privatevalCODE_WRITE_EXTERNAL=1varfile:File?=nullvarmPaint:Paint?=null//vardialog:ProgressDialog?=nullvarscreenWidth:Int=0varscreenHeight:Int=0@RequiresApi(Build.VERSION_CODES.KITKAT)override funonCreate(savedInstan...
val call: retrofit2.Call<ResponseBody> = httpbinService.post("xxx", "xxx")call.enqueue(object : retrofit2.Callback<ResponseBody> {//请求完成override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) {try {Log.e("data", "${response.body()?.string()}")} catch...
This project has a dependency on another which set Kotlin v1.3.20. The dependency project had the Kotlin version bumped up to v1.3.60. This bit broke with the update as per the following:A - [ERROR] <pathToFile> [line, position] Type inference failed: ...
= null && when (partBody.type.toLowerCase()) { "video", "image", "file" -> true else -> false } ) { sb.append("***\n") sb.append("***这里是文件的数据,省略输出***\n") sb.append("***\n\n") } else { sb.append( String.format( "【MultipartBody = %s】", format...