use of com.github.hakko.musiccabinet.domain.model.library.Directory in project musiccabinet by hakko.
the class DirectoryBrowserServiceTest method addsDirectory.
@Test
public void addsDirectory() throws ApplicationException {
scannerService.add(set(cd1));
Directory root = getFirstRootDirectory();
browserService.addDirectory(cd1 + separatorChar + "subdir", root.getId());
Set<Directory> subDirs = browserService.getSubDirectories(root.getId());
Assert.assertFalse(subDirs.isEmpty());
Assert.assertEquals(1, subDirs.size());
Assert.assertEquals(cd1 + separatorChar + "subdir", subDirs.iterator().next().getPath());
}
use of com.github.hakko.musiccabinet.domain.model.library.Directory 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;
}
Aggregations