From dev-return-16794-archive-asf-public=cust-asf.ponee.io@reef.apache.org Wed Jun 13 22:59:56 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 CA2D8180609 for ; Wed, 13 Jun 2018 22:59:55 +0200 (CEST) Received: (qmail 47781 invoked by uid 500); 13 Jun 2018 20:07:38 -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 47769 invoked by uid 99); 13 Jun 2018 20:07:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2018 20:07:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 68EB8C05DA for ; Wed, 13 Jun 2018 20:07:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id zgjtgAZm_K23 for ; Wed, 13 Jun 2018 20:07: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 55B9A5F542 for ; Wed, 13 Jun 2018 20:07: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 9F1EAE050B for ; Wed, 13 Jun 2018 20:07: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 2A7C121811 for ; Wed, 13 Jun 2018 20:07:00 +0000 (UTC) Date: Wed, 13 Jun 2018 20:07: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= 606#comment-16511606 ]=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_r195218006 =20 =20 ########## File path: lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureBlockBlobF= ileSystem.cs ########## @@ -123,6 +123,18 @@ 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) + { + var path =3D uri.AbsolutePath.Trim('/'); + var blobItems =3D _client.ListBlobsSegmented(path, false, Blob= ListingDetails.Metadata, 1, null, null, null).Results; =20 Review comment: const static? =20 --- In reply to: [194580367](https://github.com/apache/reef/pull/1473#discus= sion_r194580367) [](ancestors =3D 194580367,194554180) ---------------------------------------------------------------- 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)