Here you can find the source of getFileNameWithAddedExtension(File parent, File f, String ext)
public static File getFileNameWithAddedExtension(File parent, File f, String ext)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static File getFileNameWithAddedExtension(File parent, File f, String ext) { File ff = new File(parent, f.getName() + ext); if (ff.exists()) { return ff; }/* ww w . j a va 2 s .c om*/ return null; } }