* helper method that could be useful in scripts and otherwise

This commit is contained in:
Reinhard Pointner 2014-07-17 07:50:30 +00:00
parent 76073cfb9d
commit 7385a8d307
1 changed files with 15 additions and 0 deletions

View File

@ -1371,6 +1371,21 @@ public class MediaDetection {
} }
}; };
public static List<File> getMediaUnits(File folder) {
if (folder.isHidden()) {
return emptyList();
}
if (folder.isDirectory() && !isDiskFolder(folder)) {
List<File> children = new ArrayList<File>();
for (File f : getChildren(folder)) {
children.addAll(getMediaUnits(f));
}
}
return singletonList(folder);
}
public static Object readMetaInfo(File file) { public static Object readMetaInfo(File file) {
if (useExtendedFileAttributes()) { if (useExtendedFileAttributes()) {
try { try {