/** * Ensure that delete will not be successful in non-empty directory when recursive flag is set to {@code false}. * * @throws Exception If failed. */ @Test public void testDeleteDirectoryNotEmpty() throws Exception { create(igfs, paths(DIR, SUBDIR, SUBSUBDIR), paths(FILE)); checkExist(igfs, igfsSecondary, SUBDIR, SUBSUBDIR, FILE); try { boolean ok = igfs.delete(SUBDIR, false); assertFalse(ok); } catch (IgfsDirectoryNotEmptyException ignore) { // No-op, expected. } checkExist(igfs, igfsSecondary, SUBDIR, SUBSUBDIR, FILE); }