Reputation: 1
I'm working on a blackberry application which do some file handling, I would like to know how I can check a specific folder and delete only files with a specific extension. For example, I only want to delete my .log files.
Upvotes: 0
Views: 231
Reputation: 146
FileConnection dir = (FileConnection) Connector.open(path);
Enumeration dirContent = dir.list("*.*", true);
FileConnection file = (FileConnection) Connector.open(filePath);
if (file.exists()) {
file.delete();
}
Upvotes: 1
Reputation: 28418
Please, spend some time studying the FileConnection API. It has everything you need.
Upvotes: 1