I mostly work in C# but here's my attempt working with what you posted.
public boolean operate_on_file(java.util.ArrayList<java.io.File> files,File current_dir) {
try{
for (File file : files) {
BufferedImage image = ImageIO.read(file);
File output = new File(current_dir+"/"+file.getName());
ImageIO.write(image, "png", output);
}
}
catch(Exception e){
return false;
}
return true;
}
}