gpt4 book ai didi

java - 从驱动程序实现访问设备凭据的最简单方法?

转载 作者:行者123 更新时间:2023-12-01 09:20:17 25 4
gpt4 key购买 nike

我正在构建一个类来简化从 cumulocity 向设备分发文件的过程

/**
* Class to simplify pushing files to the devices
*/
public class GenericFileUploadDriver implements Driver, OperationExecutor {

使用 c8y_DownloadConfigFile 我可以挖掘出客户端上的文件 URL,因为我显然需要手动进行身份验证才能访问该文件。

我想使用 cfg/device.properties 文件中的凭据。我想知道从这个上下文中访问这些内容的最简单方法是什么?

谢谢

最佳答案

您可以将其从您传递的 Platform 对象中取出:

public void initialize(Platform platform) throws Exception {
PlatformParameters parms = (PlatformParameters)platform;
String user = parms.getUser();
String password = parms.getPassword();
// ...
}

关于java - 从驱动程序实现访问设备凭据的最简单方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40208903/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com