[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-19 Thread Boris Petrov (JIRA)

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

Boris Petrov commented on VFS-661:
--

There is a thread about jCIFS supporting this but I don't think it is resolved 
unfortunately: https://lists.samba.org/archive/jcifs/2004-January/002923.html

> 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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-18 Thread Bernd Eckenfels (JIRA)

[ 
https://issues.apache.org/jira/browse/VFS-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-18 Thread Boris Petrov (JIRA)

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

Boris Petrov commented on VFS-661:
--

Well, I just do a:

{code:java}
...
fileSystemManager = (DefaultFileSystemManager) VFS.getManager();
...
FileSystemOptions fileSystemOptions = new FileSystemOptions();
...
FileObject file = fileSystemManager.resolveFile(filePath, fileSystemOptions);
{code}

I use the same *filePath* as an ID in the DB. So when *filePath* is 
*smb://localhost/share/folder* all works fine - the file AND the metadata are 
found. When *filePath* is *smb://localhost/share/FOLDER* - the file is found 
(the *resolveFile* from the code above returns the same file) but the DB finds 
nothing.

> 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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-18 Thread Otto Fowler (JIRA)

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

Otto Fowler commented on VFS-661:
-

I want to be sure I'm correct in the way you are finding and resolving the file.

 

> 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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-18 Thread Boris Petrov (JIRA)

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

Boris Petrov commented on VFS-661:
--

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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-18 Thread Otto Fowler (JIRA)

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

Otto Fowler commented on VFS-661:
-

Can you post a small code sample?  I want to be sure that I understand.

> 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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-18 Thread Boris Petrov (JIRA)

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

Boris Petrov commented on VFS-661:
--

The issue is that I can't get the real name. I guess it is correct to resolve 
the "wrong" name as the file system is case-insensitive but in that case I need 
also to be able to get the real name.

Yes, having a per provider setting is even better, but that is going to be way 
more difficult to implement (if at all possible - how do you do 
case-sensitivity on Windows?).

> 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)


[jira] [Commented] (VFS-661) Ability to get "real"/"native"/"physical" file name

2018-04-17 Thread Otto Fowler (JIRA)

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

Otto Fowler commented on VFS-661:
-

Is the issue that you can't get the real name, or that the wrong name resolves? 
 Wouldn't the better fix be to allow on a per Provider/FS basis a setting that 
makes it case sensitive/insensitive?

If you can 'turn it on' than it would be backward compatible.

 

> 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)