UploadService - getAllFiles returns custom code files as well

0 votes

calling



uploadService.getAllFiles(100, s * 100);



returns all my files plus all my uploaded custom code files.

How can I safely distinguish between those files?

Btw., for me this is really not intuitive as even in the app console I don't see those files mixed up!

Side effect is following: I create an app and upload files and don't use custom code. Everything works fine, After some time I develop some custom code and suddenly my app crashes as it does not understand the custom code files data...

 

I'm using App42_ANDROID_SDK_3.2.jar

asked Feb 23, 2015 in App42 Cloud API-BaaS by mflisar85 (40 points)
edited Feb 23, 2015 by mflisar85

1 Answer

0 votes

Hello,

You can remove the custom code .jar files from the list by its name or its type. Please find a below code snippet for the same and let me know if it helps:

 

App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");

UploadService uploadService = App42API.buildUploadService();

uploadService.getAllFiles(new App42CallBack() {

public void onSuccess(Object response) 

{

                Upload upload = (Upload)response;                                                                                               

                ArrayList<Upload.File>  fileList = upload.getFileList();   

                for(int i = 0; i < fileList.size();i++ )  

                {  

                                System.out.println("fileName is :" + fileList.get(i).getName());  

                // By Custom name

                if(getAllFilesObj.getFileList().get(i).getName().equals("_App42_CustomCode_deploy")){

                // Here deploy is a custom code name

                    System.out.println("fileUrl is :" + fileList.get(i).getUrl());  

               }

               // By Type

                if(getAllFilesObj.getFileList().get(i).getType().equals("OTHER")){

                    System.out.println("fileUrl is :" + fileList.get(i).getUrl());  

               }

                }             

}

public void onException(Exception ex) 

{

                System.out.println("Exception Message"+ex.getMessage());    

}

});

 

Thanks,

Himanshu Sharma

 

answered Feb 24, 2015 by hs00105 (2,005 points)
that's what I do currently because I use only json files. Does this mean, file type "OTHER" is only used for this custom code files?
Hello Michael,
 
Other is used for file which is not in AUDIO,VIDEO,IMAGE,BINARY,TXT,XML,CSV,JSON,HTML File

Thanks,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...