public static void deleteAll(String start) { deleteAll(Paths.get(start)); }
/** Delete a {@code DataState}. Do not use the {@code DataState} again. * This operation makes the state on disk inacessible on reboot. * (It may delete the old contents.) */ public void delete(Id dsRef) { synchronized (zoneLock) { DataState dataState = get(dsRef); states.remove(dataState.getDataSourceId()); datasets.remove(dataState.getDataSourceId()); external.remove(dataState.getDataSourceId()); if ( stateArea != null ) { Path path = stateArea.resolve(dataState.getDatasourceName()); if ( true ) { // Really delete. IOX.deleteAll(path); } else { // Move aside. Path path2 = IOX.uniqueDerivedPath(path, (x)->x+DELETE_MARKER); try { Files.move(path, path2, StandardCopyOption.ATOMIC_MOVE); } catch (IOException e) { throw IOX.exception(e); } } } } }