Here you can find the source of getAllFilePath(String filedir)
@SuppressWarnings("rawtypes") private static List getAllFilePath(String filedir)
//package com.java2s; /**//from w ww. ja v a 2 s .c om * Automatic Subtitle Downloader * http://code.google.com/p/autosubdown/ * * Copyright 2010-2011 Raphael Medeiros. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 */ import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { @SuppressWarnings("rawtypes") private static List getAllFilePath(String filedir) { File f = new File(filedir); List<File> l = new ArrayList<File>(); getFilePaths(f, l); return l; } private static void getFilePaths(File dir, List<File> l) { if (dir.isDirectory()) { File d[] = dir.listFiles(); for (int i = 0; i < d.length; i++) { getFilePaths(d[i], l); } } else if (dir.isFile()) { l.add(dir); } } }