From dev-return-66918-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Jan 22 15:38:49 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 CE26D180609 for ; Mon, 22 Jan 2018 15:38:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B6668160C4D; Mon, 22 Jan 2018 14:38:49 +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 00360160C4B for ; Mon, 22 Jan 2018 15:38:48 +0100 (CET) Received: (qmail 40247 invoked by uid 500); 22 Jan 2018 14:38:46 -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 39748 invoked by uid 99); 22 Jan 2018 14:38:46 -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; Mon, 22 Jan 2018 14:38:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 15A19F182D; Mon, 22 Jan 2018 14:38:45 +0000 (UTC) From: anmolnar 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: <20180122143845.15A19F182D@git1-us-west.apache.org> Date: Mon, 22 Jan 2018 14:38:45 +0000 (UTC) Github user anmolnar commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/450#discussion_r162945589 --- 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 -- Same here with the dot. ---