Java File Name Get getFileNameWithAddedExtension(File parent, File f, String ext)

Here you can find the source of getFileNameWithAddedExtension(File parent, File f, String ext)

Description

get File Name With Added Extension

License

Open Source License

Declaration

public static File getFileNameWithAddedExtension(File parent, File f, String ext) 

Method Source Code


//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;
    }
}

Related

  1. getFileNamesOld(File zipFile)
  2. getFileNamesRecursive(final String pDataDir, final FilenameFilter pFilter, final int pMaxFiles)
  3. getFileNameStartingWith(String directory, String prefix)
  4. getFilenameSuffix(final File file)
  5. getFileNameUtil(String dataPath)
  6. getFileNameWithNewExtension(File parent, File file, String ext)
  7. getFilenameWithoutAnyExtension(File file)
  8. getFileNameWithoutExt(File file)
  9. getFileNameWithoutExt(File filePath)