commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Eckenfels (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name
Date Thu, 19 Apr 2018 00:25:00 GMT

    [ https://issues.apache.org/jira/browse/VFS-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16443380#comment-16443380
] 

Bernd Eckenfels commented on VFS-661:
-------------------------------------

It hink it is a good idea to add FileObject#resolveCanonical() returning the canonical FileName.
For local files this would map to File#getCanonicalPath()

However I am not sure if the Cifs API does Support that anyway.

But for your usecase you could either use a case insensitive comparator or store the URL in
lowercase.

FileName resolveCanonical() instead of getCanonicalFile to make it clear it’s a slow IO
intensive method (not the missleading getter from java.io)

> Ability to get "real"/"native"/"physical" file name
> ---------------------------------------------------
>
>                 Key: VFS-661
>                 URL: https://issues.apache.org/jira/browse/VFS-661
>             Project: Commons VFS
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Boris Petrov
>            Priority: Major
>
> On case-insensitive file systems (local FS on Windows; Samba; etc) resolving a file ignores
the case that is used. For example, if there is a folder like: *smb://localhost/share/folder*
and is resolved with *smb://localhost/share/FOLDER* it would work and return the same folder.
However, there is no method in the *FileObject* interface that allows us to get the "real"/"physical"
name of the folder - i.e. *folder*. All of the methods would return *FOLDER* in this case.
> We have a major usecase where we need that. The only solution I can think of is getting
the parent folder, going through its children and thus finding the correct case but the performance
of that would be horrible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message