Questions tagged [filenotfoundexception]

A Java or Android exception that indicates that the file denoted by a specified pathname could not be opened.

This exception is part of the old Java file API. Newer code in Java (note: NOT Android) should use JSR 203 instead (i.e. Paths, Files). JSR 203 (known as NIO.2) has its own java.nio.file.NoSuchFileException, see also .

One problem with this exception is that despite its name, it doesn't always mean that the filesystem object at the given path is actually missing. Here are a few possibilities where this exception can be thrown with a cause other than the file missing:

  • permission denied: an attempt is made to open the file in write mode but the process only has read only access; or the file is in a directory the contents of which the application cannot access;
  • read only filesystem: an attempt is made to open the file in write mode, the process has write access to the file but the underlying filesystem is read only;
  • symbolic link loop: the denoted path is a symbolic link which loops on itself.
1712 questions
0
votes
2 answers

Save the path of a picture on shared preferences

On my code, users can select a "profile picture" Users select the picture from gallery (ok work) resize and crop (ok work) i have a problem to share the path of the picture, because i have to see that picture in other activity i thing to save the…
Lele
  • 703
  • 3
  • 15
  • 34
0
votes
3 answers

Java unhandled file type on object constructor

I'm trying to have the file "TutorialMap" used as the map in this TutorialMission. I keep getting told that the MapReader "reader" needs to be static, but when it's static, I get told "Unhandled exception type FileNotFoundException" with the error…
0
votes
1 answer

FileNotFoundException while creating a file with java in Ubuntu?

I have been trying to convert millions of xml documents to txt files. After reading each xml I parse the required content and write it into a new text file in a new drectory. But when I process some large number of files like more than 7000, I am…
vivek_jonam
  • 3,237
  • 8
  • 32
  • 44
0
votes
1 answer

unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown 6

We keep running this error. The goal is to read the data from the array into an output file. Thanks for the help! public static void save(Salesperson[] array) { PrintStream outfile = null; try { outfile = new…
0
votes
2 answers

Catching FileNotFound in stack trace?

This might seem like a weird question, but is it possible to "catch"(know) if there is a filenotfoundexception in the stack trace? I am asking this because the class I am implementing (not mine) does not throw the exception, it catches it and prints…
problemo
  • 629
  • 4
  • 13
0
votes
1 answer

XNA - File Not Found

Can't find the answer anywhere, hoping you guys can help, thanks in advanced. These were loaded in the beginning of the file- SpriteBatch mBatch; Texture2D mTheQuantumBros2; protected override void LoadContent() { //…
TheQuantumBros
  • 308
  • 3
  • 4
  • 17
0
votes
2 answers

relative file path not working in Java

After reading that is it possible to create a relative filepath name using "../" I tried it out. I have a relative path for a file set like this: String dir = ".." + File.separator + "web" + File.separator + "main"; But when I try setting the file…
Seephor
  • 1,692
  • 3
  • 28
  • 50
0
votes
2 answers

Why am I getting a FileNotFoundException? I can see the file at this location so I know it exists

I have a file list with a longclicklistener that brings up a context menu with delete and rename options. These launch either a deleteDialog() or renameDialog(). These call either delete() or rename(). The delete works but rename is giving: 05-05…
RapsFan1981
  • 1,177
  • 3
  • 21
  • 61
0
votes
2 answers

Android: FileNotFoundException How Do I create the file?

I have the following code: try{ File sdCard = Environment.getExternalStorageDirectory(); File directory = new File (sdCard.getAbsolutePath() + "/statReporter/"); directory.mkdirs(); //Path and…
wwjdm
  • 2,568
  • 7
  • 32
  • 61
0
votes
2 answers

java eclipse- fileReader throws FileNotFoundException though .exists() returns true

when i attempt to create a BufferedReader using a text file in my workspace the FileReader in the "new bufferedreader statement throws a filenotfoundexception. yet .exists() and .canRead() both return true for the file public static void…
irksomesloth
  • 35
  • 1
  • 6
0
votes
1 answer

configure() not be called when running on hadoop cluster but can be called on Eclipse, DistributedCache FIleNotFoundException

My program use a DistributedCache to cache files JobConf conf = new JobConf(new Configuration(), ItemMining.class); DistributedCache.addCacheFile(new URI("output1/FList.txt"), conf); DistributedCache.addCacheFile(new URI("output1/GList.txt"),…
0
votes
0 answers

FileNotFoundException while exporting to excel using JasperReports

i have developed application in JSF 1.2, RichFaces and running on Apache Tomcat. Have used JasperReports (with iReport 4) to generate pdf file from application and its perfectly ok. Now i want to export same files to excel instead of pdf. I used…
learner
  • 757
  • 2
  • 14
  • 35
0
votes
1 answer

FileNotFound Exception on Accesing PHP file in Android

I am trying on Client/Server side application in android. I have a php file which simply get or post data. On Android I have an activity which get and post data from server file. I hav problem in accessing that file which is located on…
User42590
  • 2,473
  • 12
  • 44
  • 85
0
votes
1 answer

Use property file in a JAR

After a lot of property file articles and comments I am really lost. All I want is to retrieve values and to overwrite them - and I want to use that with a jar-file. If I compile in eclipse it works perfectly but the moment I compile I got the…
tomier
  • 1
  • 4
0
votes
1 answer

File not being written on Android

I am trying to write a file to internal memory in my android application, however, although this code is called, later when I try to read the file the app crashes with the fileNotFound exception. I am attempting to write an array, with each…
jackgerrits
  • 791
  • 2
  • 8
  • 20
1 2 3
99
100