Mike Simmons wrote:Well, there are a number of possible reasons for delete() to return true - but from your description, I think the most likely scenario is that something is still reading or writing those files at the time you first try to delete them. So first: are you sure that whatever you're doing to these files is really complete? It's possible you're simply trying to delete the files too early. Second, did you remember to close all streams or RandomAccessFile objects as soon as you were done with them? The behavior you describe could be because there's a stream object that hasn't been closed yet, and hasn't been garbage collected. Make sure all streams and other Closeable objects are closed in a finally block, to make sure it happens even if an exception is thrown.
I checked my code again and only one place I am using two streams (FileInputStream and ByteArrayOutputstreams) and I am closing both of them in finally block. Let me give you overview the way I have implemented this.
1) First look at specific location if new files are available,
2) Load the File object in another class ImageDataBlock,
ImageDataBlock.java
3) Parsing