[ 
https://issues.apache.org/jira/browse/HADOOP-6585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eli Collins updated HADOOP-6585:
--------------------------------

    Attachment: hadoop-6585-1.patch

Patch attached. The change is fairly straightforward since almost all uses of 
isDir are called on FileStatus object retrieve using getFileStatus. Since 
getFileStatus fully resolves links the resulting status is either a file or a 
directory so !isDir can simply be replaced with isFile. Since FileSystem does 
not support symlinks isDir is equivalent to isDirectory, and isFile is 
equivalent to !isDir so those changes are straightforward as well.  This patch 
applies against trunk with the patches for HADOOP-6563, and HADOOP-6678 applied.

> Add FileStatus#isDirectory and isFile
> -------------------------------------
>
>                 Key: HADOOP-6585
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6585
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 0.22.0
>            Reporter: Eli Collins
>            Assignee: Eli Collins
>             Fix For: 0.22.0
>
>         Attachments: hadoop-6585-1.patch
>
>
> Per Sanjay's suggestion in HADOOP-6421 let's deprecate FileStatus#isDir() and 
> add isDirectory() and isFile() to compliment isSymlink. Currently clients 
> assume !isDir() implies a file, which is no longer true with symlinks. I'll 
> file a separate jira to change the various uses of !isDir() to be isFile() or 
> isFile() or isSymlink() as appropriate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to