/** * Delete the specified file or directory and increment metrics. * If the file or directory does not exist, the operation returns false. * @param path the path to a file or directory. * @param isDir true if the path is a directory; otherwise false. * @return true if delete is successful; otherwise false. * @throws IOException if an IO error occurs while attempting to delete the * path. * */ @VisibleForTesting boolean deleteFile(String path, boolean isDir) throws IOException { if (!store.delete(path)) { return false; } if (isDir) { instrumentation.directoryDeleted(); } else { instrumentation.fileDeleted(); } return true; }
instrumentation.directoryDeleted();