草庐IT

PdfViewer-FileNotFoundException

全部标签

android - java.io.FileNotFoundException (Permission denied) 尝试写入 Android sdcard 时

我正在尝试从照片库中选择一个图像文件并写入SD卡。下面是导致异常的代码。尝试创建FileOutputStream时似乎会引发此异常。我将以下行添加到嵌套在应用程序元素内的list文件中。我找不到问题的解决方案:publicbooleansaveSelectedImage(UriselectedImage,intimageGroup,intimageNumber){booleanexception=false;InputStreaminput=null;OutputStreamoutput=null;if(externalStorageIsWritable()){try{ContentR

android - 从 Assets 目录读取文件抛出 FileNotFoundException

我正在尝试读取一个包含一堆单词的文本文件,这些单词要用于我正在编写的文字游戏。此列表存储在assets目录中,是一个txt文件。但是,每当我尝试打开它时,它都会引发异常。ListwordList=newArrayList();BufferedReaderbr=null;try{br=newBufferedReader(newInputStreamReader(getAssets().open("wordlist.txt")));//throwingaFileNotFoundException?Stringword;while((word=br.readLine())!=null)wor

android - 从 Assets 目录读取文件抛出 FileNotFoundException

我正在尝试读取一个包含一堆单词的文本文件,这些单词要用于我正在编写的文字游戏。此列表存储在assets目录中,是一个txt文件。但是,每当我尝试打开它时,它都会引发异常。ListwordList=newArrayList();BufferedReaderbr=null;try{br=newBufferedReader(newInputStreamReader(getAssets().open("wordlist.txt")));//throwingaFileNotFoundException?Stringword;while((word=br.readLine())!=null)wor

Android 媒体流错误? java.io.FileNotFoundException : No content provider :http://

我关注了this在android中播放流广播这里它工作正常,但点击后播放器加载有点慢我需要等待30多秒的时间但我在控制台中收到此错误MediaPlayer:setDataSourceIOExceptionhappend:java.io.FileNotFoundException:Nocontentprovider:http://www.example.com:8000/live.oggatandroid.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1074)atandroid.con

Android 媒体流错误? java.io.FileNotFoundException : No content provider :http://

我关注了this在android中播放流广播这里它工作正常,但点击后播放器加载有点慢我需要等待30多秒的时间但我在控制台中收到此错误MediaPlayer:setDataSourceIOExceptionhappend:java.io.FileNotFoundException:Nocontentprovider:http://www.example.com:8000/live.oggatandroid.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1074)atandroid.con

android - Ice Cream Sandwich 中 HttpURLConnection 的 FileNotFoundException

我有一个Android应用在Android2.x和3.x上运行良好,但在Android4.x上运行时失败。问题出在这段代码中:URLurl=newURL("http://blahblah.blah/somedata.xml");HttpURLConnectionurlConnection=(HttpURLConnection)url.openConnection();urlConnection.setRequestMethod("GET");urlConnection.setDoOutput(true);urlConnection.connect();InputStreaminputS

android - Ice Cream Sandwich 中 HttpURLConnection 的 FileNotFoundException

我有一个Android应用在Android2.x和3.x上运行良好,但在Android4.x上运行时失败。问题出在这段代码中:URLurl=newURL("http://blahblah.blah/somedata.xml");HttpURLConnectionurlConnection=(HttpURLConnection)url.openConnection();urlConnection.setRequestMethod("GET");urlConnection.setDoOutput(true);urlConnection.connect();InputStreaminputS

java - 使用 docker 容器中的 java 访问类路径中的 JSON 文件时遇到 FileNotFoundException(SprintBootApplication)

我在使用docker容器加载位于Javajar的类路径中的JSON文件时遇到FileNotFoundException,它是一个Spring-Boot应用程序。此JSON文件在资源文件夹中可用。我能够在./target/classes/路径下的docker中看到JSON文件。Resourceresource=resourceLoader.getResource("classpath:folderNm/file.json");HashMapheaderMapping=(HashMap)parser.parse(newFileReader(resource.getFile().getAbs

java - 使用 docker 容器中的 java 访问类路径中的 JSON 文件时遇到 FileNotFoundException(SprintBootApplication)

我在使用docker容器加载位于Javajar的类路径中的JSON文件时遇到FileNotFoundException,它是一个Spring-Boot应用程序。此JSON文件在资源文件夹中可用。我能够在./target/classes/路径下的docker中看到JSON文件。Resourceresource=resourceLoader.getResource("classpath:folderNm/file.json");HashMapheaderMapping=(HashMap)parser.parse(newFileReader(resource.getFile().getAbs

java.io.FileNotFoundException :/storage/emulated/0/New file. txt:打开失败:EACCES(权限被拒绝)

我一直在尝试加密文件并将这些文件写回到同一个地方。但我收到错误消息说"java.io.FileNotFoundException:/storage/emulated/0/Newfile.txt:openfailed:EACCES(Permissiondenied)".我的Manifest文件是这个我想我在那里提供了正确的许可。我用来加密文件的代码就是这个。publicstaticvoidencrypt(SecretKeysecretKey,StringfilePath){try{//Hereyoureadthecleartext.FileInputStreamfis=newFileIn