codenameone - getAppHomePath() seems to throw a wrong path in Simulator? -


i have problem getapphomepath() method, 1 returns "file://home/" in debugger, afterwards filenotfoundexception.

code throws exception:

filename = "100004_2016-06-29.jpg" apphomepath = filesystemstorage.getinstance().getapphomepath(); img = image.createimage(storage.getinstance().createinputstream(apphomepath + filename)); 

exceptionmessage:

java.io.filenotfoundexception: c:\users\xyz\.cn1\file___home_100004_2016-06-29.jpg (das system kann die angegebene datei nicht finden) 

so seems adds prefix "file___home_" corrupts path, have file "100004_2016-06-29.jpg" stored under path.

the snippet creates file under path below:

img = image.createimage(filesystemstorage.getinstance().openinputstream(filepath)); outputstream os = storage.getinstance().createoutputstream(newfilename); imageio.getimageio().save(img, os, imageio.format_jpeg, 1.0f); 

the filepath variable returned imagegallery, under %temp%.

anyway storing file works, reading somehow not.

am missing or there bug in simulator code?

the problem mixed usage of storage & filesystemstorage 2 different classes. unfortunately simulator maps storage same location maps filesystemstorage need fix avoid such cases.

you need pick 1 api , use that. imageio works filesystemstorage need absolute files that.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -