From dev-return-66970-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Jan 23 17:03:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 9A032180621 for ; Tue, 23 Jan 2018 17:03:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 89F9C160C39; Tue, 23 Jan 2018 16:03:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C8084160C17 for ; Tue, 23 Jan 2018 17:03:04 +0100 (CET) Received: (qmail 99202 invoked by uid 500); 23 Jan 2018 16:03:03 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 99184 invoked by uid 99); 23 Jan 2018 16:03:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2018 16:03:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0CC92E0BAE; Tue, 23 Jan 2018 16:03:03 +0000 (UTC) From: mfenes To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #450: ZOOKEEPER-2967: Add check to validate dataDir a... Content-Type: text/plain Message-Id: <20180123160303.0CC92E0BAE@git1-us-west.apache.org> Date: Tue, 23 Jan 2018 16:03:03 +0000 (UTC) Github user mfenes commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/450#discussion_r163290319 --- Diff: src/java/main/org/apache/zookeeper/server/persistence/Util.java --- @@ -294,5 +297,25 @@ public int compare(File o1, File o2) { Collections.sort(filelist, new DataDirFileComparator(prefix, ascending)); return filelist; } + + /** + * Returns true if file is a log file. + * + * @param file + * @return + */ + public static boolean isLogFile(File file) { + return file.getName().startsWith(LOG_FILE_PREFIX); + } + + /** + * Returns true if file is a snapshot file. + * + * @param file + * @return + */ + public static boolean isSnapshotFile(File file) { + return file.getName().startsWith(SNAP_FILE_PREFIX); --- End diff -- Ok, I'll include the dot in the check. ---