use of org.olat.core.util.vfs.filters.VFSItemExcludePrefixFilter in project OpenOLAT by OpenOLAT.
the class CPFile method deleteIfEmpty.
/**
* Deletes the container if it is empty (excluding files with '.' prefix).
*
* @param parentContainer
*/
private void deleteIfEmpty(VFSContainer container) {
String[] unwantedPrefixes = { "." };
VFSItemFilter filter = new VFSItemExcludePrefixFilter(unwantedPrefixes);
if (container != null) {
List<VFSItem> items = container.getItems(filter);
if (items == null || items.size() == 0) {
container.delete();
}
}
}
use of org.olat.core.util.vfs.filters.VFSItemExcludePrefixFilter in project openolat by klemens.
the class CPFile method deleteIfEmpty.
/**
* Deletes the container if it is empty (excluding files with '.' prefix).
*
* @param parentContainer
*/
private void deleteIfEmpty(VFSContainer container) {
String[] unwantedPrefixes = { "." };
VFSItemFilter filter = new VFSItemExcludePrefixFilter(unwantedPrefixes);
if (container != null) {
List<VFSItem> items = container.getItems(filter);
if (items == null || items.size() == 0) {
container.delete();
}
}
}
Aggregations