File successfully uploaded by my App , but it did not appear on box file
So here is my code:
public class pCloudUpload { File outputFolder = new File("/folder/"); BoxAPIConnection api ; BoxFolder rootFolder ; public void prepareUpload() { api = new BoxAPIConnection("xxxxxxxxxxxx"); rootFolder = BoxFolder.getRootFolder(api); File[] files = outputFolder.listFiles(); if (files.length > 0) { for (File file : files) { uploadFile(file); } } else { Log.i("No_File_to_Upload", "0 files to Upload"); } } public void uploadFile(File file) { FileInputStream stream = null; BoxFolder rootFolder = BoxFolder.getRootFolder(api); try { stream = new FileInputStream(file); rootFolder.uploadFile(stream, file.getName()); Log.i("File Uploaded", "File Uploaded"); } catch (Exception ex) { System.out.print(ex); } finally { try { if (stream != null) { stream.close(); } } catch (Exception ex) { Log.i("Exception in Closing", "Exception caught during closing of stream"); } } } }
On logcat of android studio , I get Log that file is successfully uploaded but when i open my account there are no files at all. See the screenshot below:
Please Help me...
Please sign in to leave a comment.
Comments
0 comments