2016-10-23 1 views
0

は、私は明らかに手動でそれにアクセスするための認証に必要なIによって、クライアント上のファイルのURLを鉱山を私ができるc8y_DownloadConfigFileを使用しcumulocityドライバの実装からデバイスの資格情報にアクセスする最も簡単な方法は?

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

からデバイスへの配布ファイルを簡素化するために、クラスを製作しています。

cfg/device.propertiesファイルの資格情報を使用します。 私はこのコンテキストからアクセスする最も簡単な方法は何ですか?

おかげ

答えて

1

あなたが渡されるプラットフォームのオブジェクトからそれを突くことができます:

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

それを釘付け
+0

、あなたにアンドレに感謝 – Peter

関連する問題