Im currently playing with file downloads. But I'm currently facing a weird error :
05-23 17:39:45.917: E/(5036): java.io.FileNotFoundException: /mnt/sdcard/Pictures/"Samsung ()+-* Samsung.jpg": open failed: EINVAL (Invalid argument)
05-23 17:39:45.917: E/(5036): at libcore.io.IoBridge.open(IoBridge.java:406)
05-23 17:39:45.917: E/(5036): at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
05-23 17:39:45.917: E/(5036): at java.io.FileOutputStream.<init>(FileOutputStream.java:128)
05-23 17:39:45.917: E/(5036): at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
05-23 17:39:45.917: E/(5036): at com.end.utils.InternalFileUtils.copyFile(InternalFileUtils.java:458)
05-23 17:39:45.917: E/(5036): at com.end.activities.filopeartions.MultipleDownloadActivity$MultipleDownloadAsyncTask.downladFile(MultipleDownloadActivity.java:260)
05-23 17:39:45.917: E/(5036): at com.end.activities.filopeartions.MultipleDownloadActivity$MultipleDownloadAsyncTask.doInBackground(MultipleDownloadActivity.java:209)
05-23 17:39:45.917: E/(5036): at com.end.activities.filopeartions.MultipleDownloadActivity$MultipleDownloadAsyncTask.doInBackground(MultipleDownloadActivity.java:174)
05-23 17:39:45.917: E/(5036): at android.os.AsyncTask$2.call(AsyncTask.java:264)
05-23 17:39:45.917: E/(5036): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
05-23 17:39:45.917: E/(5036): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
05-23 17:39:45.917: E/(5036): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
05-23 17:39:45.917: E/(5036): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
05-23 17:39:45.917: E/(5036): at java.lang.Thread.run(Thread.java:856)
05-23 17:39:45.917: E/(5036): Caused by: libcore.io.ErrnoException: open failed: EINVAL (Invalid argument)
05-23 17:39:45.917: E/(5036): at libcore.io.Posix.open(Native Method)
05-23 17:39:45.917: E/(5036): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
05-23 17:39:45.917: E/(5036): at libcore.io.IoBridge.open(IoBridge.java:390)
05-23 17:39:45.917: E/(5036): ... 13 more
Here's my code :
458 FileChannel outChannel = new FileOutputStream(mediaFileName).getChannel();
And then I do other stuffs but I think the new FileOutputStream is where it crashes. One the character (surely the *) is in cause but I don't understand why and how I can make it work (since on android with adb shell, i can create a file with this name). Any idea ? thanks