use of com.github.hakko.musiccabinet.domain.model.aggr.DirectoryContent in project musiccabinet by hakko.
the class DirectoryBrowserService method getDirectoryDiff.
public DirectoryContent getDirectoryDiff(int directoryId) {
Directory dir = dao.getDirectory(directoryId);
Set<String> dbSubDirs = presenceDao.getSubdirectories(dir.getPath());
Set<File> dbFiles = presenceDao.getFiles(dir.getPath());
DirectoryContent found = getContent(dir);
removeIntersection(dbSubDirs, found.getSubDirectories());
removeIntersection(dbFiles, found.getFiles());
return found;
}
use of com.github.hakko.musiccabinet.domain.model.aggr.DirectoryContent in project musiccabinet by hakko.
the class LibraryScanner method preVisitDirectory.
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
DirectoryContent parentContent = map.get(dir.getParent());
if (parentContent != null) {
parentContent.getSubDirectories().add(dir.toString());
}
map.put(dir, new DirectoryContent(dir.toString()));
return CONTINUE;
}
Aggregations