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 getting the FileNotFoundException.
Here is the stackTrace:
java.io.FileNotFoundException: /media/volume/data/File8838.txt (Input/output error)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at java.io.FileWriter.<init>(FileWriter.java:90)
at com.infoarmy.ir.ml.FormatData.main(FormatData.java:126)
The code snippet of FormatData is:
File newFile = new File("/media/volume/data/File8838.txt");
newFile.getParentFile().mkdirs();
BufferedWriter writer = new BufferedWriter(new FileWriter(newFile));
writer.write(builder.toString());
writer.close();
Here is the strange thing: After this exception happens I am unable to create the file using vi also. Error 212
Can anyone point out why this happens?