You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Boris Petrov (JIRA)" <ji...@apache.org> on 2018/04/18 14:27:00 UTC
[jira] [Comment Edited] (VFS-661) Ability to get
"real"/"native"/"physical" file name
[ https://issues.apache.org/jira/browse/VFS-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442584#comment-16442584 ]
Boris Petrov edited comment on VFS-661 at 4/18/18 2:26 PM:
-----------------------------------------------------------
I'm not sure what code sample you need. I can explain our use case - we are saving additional metadata for each file in a file system in a database. We walk the file system, get each file and use that as an ID in the DB. So in the DB we're going to have *smb://localhost/share/folder* as an ID. Then, when someone requests a file, we get it from the filesystem and return the metadata associated with it from the DB. However, you can imagine that when someone requests *smb://localhost/share/FOLDER*, we do find the file (on a case-insensitive file system) but the DB doesn't return the metadata as the ID is wrong and hence we return a wrong result to the user - we've found the correct file but haven't found the correct metadata.
And, as I said, there is nothing we can do about it as VFS doesn't give us the "real" name so we have no way of finding the metadata associated with it.
was (Author: boris-petrov):
I'm not sure what code sample you need. I can explain our use case - we are saving additional metadata for each file in a file system in a database. We walk the file system, get each file and use that as an ID in the DB. So in the DB we're going to have *smb://localhost/share/folder* as an ID. Then, when someone requests a file, we get it from the filesystem and return the metadata associated with it from the DB. However, you can imagine that when someone requests *smb://localhost/share/FOLDER*, we do find the file but the DB doesn't return the metadata as the ID is wrong and hence we return a wrong result to the user - we've found the correct file but haven't found the correct metadata.
And, as I said, there is nothing we can do about it as VFS doesn't give us the "real" name so we have no way of finding the metadata associated with it.
> 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)