From dev-return-16796-archive-asf-public=cust-asf.ponee.io@reef.apache.org Wed Jun 13 22:37:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7E70C18066C for ; Wed, 13 Jun 2018 22:37:08 +0200 (CEST) Received: (qmail 48526 invoked by uid 500); 13 Jun 2018 20:10:44 -0000 Mailing-List: contact dev-help@reef.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@reef.apache.org Delivered-To: mailing list dev@reef.apache.org Received: (qmail 48514 invoked by uid 99); 13 Jun 2018 20:10:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2018 20:10:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 72EBB1A06E2 for ; Wed, 13 Jun 2018 20:10:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8V1Pgbzv02KE for ; Wed, 13 Jun 2018 20:10:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 42B555F36F for ; Wed, 13 Jun 2018 20:10:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A3A6BE050B for ; Wed, 13 Jun 2018 20:10:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2F66C21811 for ; Wed, 13 Jun 2018 20:10:00 +0000 (UTC) Date: Wed, 13 Jun 2018 20:10:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@reef.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (REEF-2036) IFileSystem api to check if uri is for a directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/REEF-2036?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16511= 608#comment-16511608 ]=20 ASF GitHub Bot commented on REEF-2036: -------------------------------------- tyclintw commented on a change in pull request #1473: [REEF-2036] Add IFile= System api to check if uri is a directory URL: https://github.com/apache/reef/pull/1473#discussion_r195218945 =20 =20 ########## File path: lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLa= keFileSystem.cs ########## @@ -173,14 +173,23 @@ public void CreateDirectory(Uri directoryUri) } } =20 + /// + /// Checks if uri is a directory uri. + /// + /// uri of the directory/file + /// true if uri is for a directory else false + public bool IsDirectory(Uri uri) + { + return Exists(uri) && _adlsClient.GetDirectoryEntry(uri.Absolu= tePath).Type =3D=3D DirectoryEntryType.DIRECTORY; =20 Review comment: This fixes the double network call but the catch all could hide simple e= xceptions like a network error.=20 =20 --- In reply to: [194580374](https://github.com/apache/reef/pull/1473#discus= sion_r194580374) [](ancestors =3D 194580374,194554633) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > IFileSystem api to check if uri is for a directory > -------------------------------------------------- > > Key: REEF-2036 > URL: https://issues.apache.org/jira/browse/REEF-2036 > Project: REEF > Issue Type: New Feature > Components: REEF > Reporter: Dwaipayan Mukhopadhyay > Assignee: Dwaipayan Mukhopadhyay > Priority: Major > > Currently, there is no way to check if a location specified by a=C2=A0uri= =C2=A0is a directory or not. The only way to check it is by calling fs.GetC= hildren and checking for an exception. There should be a more graceful way = of doing this check by adding an=C2=A0api. -- This message was sent by Atlassian JIRA (v7.6.3#76005)