本文整理汇总了Java中com.smartdevicelink.proxy.rpc.ListFiles类的典型用法代码示例。如果您正苦于以下问题:Java ListFiles类的具体用法?Java ListFiles怎么用?Java ListFiles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListFiles类属于com.smartdevicelink.proxy.rpc包,在下文中一共展示了ListFiles类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testJsonConstructor
点赞 3
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
/**
* Tests a valid JSON construction of this RPC message.
*/
public void testJsonConstructor () {
JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
assertNotNull(Test.NOT_NULL, commandJson);
try {
Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
ListFiles cmd = new ListFiles(hash);
JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
assertNotNull(Test.NOT_NULL, body);
// Test everything in the json body.
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
} catch (JSONException e) {
fail(Test.JSON_FAIL);
}
}
开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:22,
代码来源:ListFilesTests.java
示例2: getSdlFiles
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
private void getSdlFiles() {
ListFiles request = new ListFiles();
request.setCorrelationID(autoIncCorrId++);
try {
proxy.sendRPCRequest(request);
} catch (SdlException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
开发者ID:smartdevicelink,
项目名称:sdl_mobileweather_tutorial_android,
代码行数:11,
代码来源:SmartDeviceLinkService.java
示例3: uploadImages
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
/**
* Requests list of images to SDL, and uploads images that are missing.
*/
private void uploadImages(){
ListFiles listFiles = new ListFiles();
listFiles.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
if(response.getSuccess()){
remoteFiles = ((ListFilesResponse) response).getFilenames();
}
// Check the mutable set for the AppIcon
// If not present, upload the image
if(remoteFiles== null || !remoteFiles.contains(SdlService.ICON_FILENAME)){
sendIcon();
}else{
// If the file is already present, send the SetAppIcon request
try {
proxy.setappicon(ICON_FILENAME, CorrelationIdGenerator.generateId());
} catch (SdlException e) {
e.printStackTrace();
}
}
// Check the mutable set for the SDL image
// If not present, upload the image
if(remoteFiles== null || !remoteFiles.contains(SdlService.SDL_IMAGE_FILENAME)){
uploadImage(R.drawable.sdl, SDL_IMAGE_FILENAME, CorrelationIdGenerator.generateId(), true);
}
}
});
this.sendRpcRequest(listFiles);
}
开发者ID:smartdevicelink,
项目名称:hello_sdl_android,
代码行数:35,
代码来源:SdlService.java
示例4: testRpcValues
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
/**
* Tests the expected values of the RPC message.
*/
public void testRpcValues () {
// Invalid/Null Tests
ListFiles msg = new ListFiles();
assertNotNull(Test.NOT_NULL, msg);
testNullBase(msg);
}
开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:10,
代码来源:ListFilesTests.java
示例5: testBuildListFiles
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
public void testBuildListFiles () {
Integer testCorrelationID = 0;
ListFiles testLF;
// Test -- buildListFiles(Integer correlationID)
testLF = RPCRequestFactory.buildListFiles(testCorrelationID);
assertEquals(Test.MATCH, testCorrelationID, testLF.getCorrelationID());
testLF = RPCRequestFactory.buildListFiles(null);
assertNotNull(Test.NOT_NULL, testLF.getCorrelationID());
}
开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:13,
代码来源:RPCRequestFactoryTests.java
示例6: uploadImages
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
/**
* Requests list of images to SDL, and uploads images that are missing.
*/
private void uploadImages(){
ListFiles listFiles = new ListFiles();
this.sendRpcRequest(listFiles);
}
开发者ID:livio,
项目名称:sdl_video_streaming_android_sample,
代码行数:9,
代码来源:SdlService.java
示例7: buildListFiles
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
public static ListFiles buildListFiles(Integer correlationID) {
ListFiles listFiles = new ListFiles();
listFiles.setCorrelationID(correlationID);
return listFiles;
}
开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:6,
代码来源:RPCRequestFactory.java
示例8: createMessage
点赞 2
import com.smartdevicelink.proxy.rpc.ListFiles; //导入依赖的package包/类
@Override
protected RPCMessage createMessage(){
return new ListFiles();
}
开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:5,
代码来源:ListFilesTests.java