Results 1 to 1 of 1
- 01-06-2011, 09:40 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 1
- Rep Power
- 0
File.class - Problem with SecurityManager
hi,
I m facing a problem in production, where sometimes my application was not able to delete the previous processed data files. The following piece of code is used for deletion. It is working properly, once in a file the files are not deleted. so i m not able to figure out the actual cause of the problem. The following code is used. can any one help me on this issue ?
thanks in advance.
public synchronized boolean deleteFiles( String path, String fileExtension ) {
FilterExtension filter = new FilterExtension(fileExtension);
File f = new File(path);
boolean isdeleted = false;
String[] list = f.list(filter);
File f2;
if (list.length == 0)
return true;
for (int i = 0; i < list.length; i++) {
f2 = new File(d + list[i]);
isdeleted = f2.delete();
if (!isdeleted){
throw new IllegalArgumentException("Err");
}else
System.out.println( " deleted ");
}
return true;
}
Similar Threads
-
JCreator problem; class Exercise1 is public, should be declared in a file named Exerc
By JehanMustafa in forum New To JavaReplies: 1Last Post: 10-08-2010, 02:19 AM -
Problem to access data when a class calls another class
By ea09530 in forum New To JavaReplies: 0Last Post: 04-04-2010, 10:06 AM -
JNI and AccessController / SecurityManager...
By fxRichard in forum Advanced JavaReplies: 0Last Post: 07-11-2009, 10:17 PM -
problem in accessing array values of one class in to jframe class
By cenafu in forum AWT / SwingReplies: 8Last Post: 03-21-2009, 09:34 AM -
Able to find class file in WEB-INF/classes but not after add sub folders in class dir
By vitalstrike82 in forum Web FrameworksReplies: 0Last Post: 05-13-2008, 06:16 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks