1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.devgui;
25
26 import java.io.*;
27
28
29
30 /***
31 * DOCUMENT ME!
32 *
33 * @author $author$
34 * @version $Revision: 1.9 $
35 */
36 public class FileUtility {
37 /***
38 * DOCUMENT ME!
39 *
40 * @param dir DOCUMENT ME!
41 * @param extensions DOCUMENT ME!
42 *
43 * @return DOCUMENT ME!
44 *
45 * @throws IOException DOCUMENT ME!
46 */
47 public static String[] getFileNamesInDirectory(File dir,
48 String[] extensions) {
49 String [] res;
50 if (extensions == null) {
51 res = dir.list();
52 } else {
53 res = dir.list(new ExtensionFilter(extensions));
54 }
55 return res;
56 }
57
58
59 /***
60 * DOCUMENT ME!
61 *
62 * @param dir DOCUMENT ME!
63 * @param extensions DOCUMENT ME!
64 *
65 * @return DOCUMENT ME!
66 *
67 * @throws IOException DOCUMENT ME!
68 */
69 public static File[] getFilesInDirectory(File dir,
70 String[] extensions) {
71 File[] res;
72 if (extensions == null) {
73 res = dir.listFiles();
74 } else {
75 res = dir.listFiles(new ExtensionFilter(extensions));
76 }
77 return res;
78 }
79 }