Skip to content
Snippets Groups Projects
Commit f93c70df authored by helene ortiz's avatar helene ortiz
Browse files

remove unused method

parent bdca6518
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@
package fr.ill.ics.tools;
import java.io.File;
import java.io.FilenameFilter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
......@@ -37,41 +36,6 @@ public class NewFileHelper {
private static final Logger LOGGER = Logger.getLogger(NewFileHelper.class.getName());
/**
* Returns a list of all the files with given extension in the given directory
* @param path
* @param extension (".xml", ".properties", ...)
* @return
*/
public static String[] getFilesListByExtension(String path, final String extension, boolean withFullPath, boolean withExtension) {
File dir = new File(path);
// Filter for files with given extension
FilenameFilter filter = new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.endsWith(extension);
}
};
// Get all files
String[] children = dir.list(filter);
// append full path to file names
if (children != null) {
for (int i = 0; i < children.length; i++) {
if (withFullPath) {
children[i] = path + children[i];
}
if (!withExtension) {
children[i] = children[i].substring(0, children[i].length() - extension.length());
}
}
}
return children;
}
public static Set<String> getSubDirectories(String directoryName) {
Set<String> directories = new HashSet<String>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment