Мой код работал хорошо без хлопот. Я действительно не могу указать, если произошло фоновое обновление и мой код не работает. Я пытаюсь создать каталог / файлы на устройстве, но выдает ошибку. Смотрите трассировку стека из Logcat и мой код ниже.
05-06 05:41:04.503 9015-9039/com.jajitech.xdata.mobile I/System.out: this is ee 43736017.collectordecision_templateVdjd
05-06 05:41:04.523 9015-9039/com.jajitech.xdata.mobile I/System.out: this is sent code 0
05-06 05:41:04.523 9015-9073/com.jajitech.xdata.mobile W/System.err: entry is Vdjd
05-06 05:41:04.903 9015-9039/com.jajitech.xdata.mobile W/System.err: mkdir failed: ENOENT (No such file or directory) : /data/user/0/com.jajitech.xdata.mobile/files/dataplat/entries/43736017.collector/decision_template/Vdjd/sent
java.io.FileNotFoundException: /data/user/0/com.jajitech.xdata.mobile/files/dataplat/entries/43736017.collector/decision_template/Vdjd/sent/sent.jaji: open failed: ENOENT (No such file or directory)
05-06 05:41:04.933 9015-9039/com.jajitech.xdata.mobile W/System.err: at libcore.io.IoBridge.open(IoBridge.java:452)
at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
at java.io.FileOutputStream.<init>(FileOutputStream.java:127)
at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
at com.codename1.impl.android.AndroidImplementation.createFileOuputStream(AndroidImplementation.java:5292)
at com.codename1.impl.android.AndroidImplementation.openFileOutputStream(AndroidImplementation.java:5196)
at com.codename1.io.FileSystemStorage.openOutputStream(FileSystemStorage.java:274)
at com.jajitech.xdata.mobile.XDataMobile$22$1.run(XDataMobile.java:1771)
at com.codename1.ui.Display.processSerialCalls(Display.java:1129)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1073)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1186)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1223)
at com.jajitech.xdata.mobile.XDataMobile.prepareToSendToCloud(XDataMobile.java:1736)
at com.jajitech.xdata.mobile.XDataMobile.lambda$NewDataEntry$17(XDataMobile.java:1457)
at com.jajitech.xdata.mobile.XDataMobile$$Lambda$16.actionPerformed(Unknown Source)
at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:349)
at com.codename1.ui.Button.fireActionEvent(Button.java:512)
at com.codename1.ui.Button.released(Button.java:546)
at com.codename1.ui.Button.pointerReleased(Button.java:650)
at com.codename1.ui.Form.pointerReleased(Form.java:2903)
at com.codename1.ui.Component.pointerReleased(Component.java:4178)
at com.codename1.ui.Display.handleEvent(Display.java:2061)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1043)
at com.codename1.ui.Display.mainEDTLoop(Display.java:961)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
at java.lang.Thread.run(Thread.java:818)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:438)
... 26 more
Найдите код под строкой 1771
char sep = FileSystemStorage.getInstance().getFileSystemSeparator();
String dir = FileSystemStorage.getInstance().getAppHomePath() + sep + "dataplat"+sep+"entries"+sep+code+sep+section+sep+entry;
Display.getInstance().callSerially(new Runnable()
{
public void run()
{
if(isSilent == false)
{
status.setMessage("Preparing to send...");
status.setShowProgressIndicator(true);
status.setIcon(createIcon(FontImage.MATERIAL_WORK));
status.show();
errorCode= "1594";
}
char sep = FileSystemStorage.getInstance().getFileSystemSeparator();
String dir = FileSystemStorage.getInstance().getAppHomePath() + sep + "dataplat"+sep+"entries"+sep+code+sep+section+sep+entry;
try
{
FileSystemStorage.getInstance().mkdir(dir + sep + "sent"+sep);
errorCode= "1595";
//Line 1771 OutputStream dest = FileSystemStorage.getInstance().openOutputStream(dir + sep + "sent" + sep + "sent.jaji");
TarOutputStream out = new TarOutputStream( new BufferedOutputStream( dest ) );
String entries[] = FileSystemStorage.getInstance().listFiles(dir);
...