Here you can find the source of getFileNames(File[] files)
private static String[] getFileNames(File[] files)
//package com.java2s; /**/*w w w .jav a 2s .c om*/ * This file is part of dev.utils. * * dev.utils is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * You should have received a copy of the GNU General Public License * along with dev.utils. If not, see <http://www.gnu.org/licenses/>. * * File : FileHelper.java * Created : November 28, 2006, 5:13 PM */ import java.io.File; public class Main { private static String[] getFileNames(File[] files) { String[] fileNames = new String[files.length]; for (int i = 0; i < fileNames.length; i++) { fileNames[i] = files[i].getName(); } return fileNames; } }