Path's .relativize documentation is wrong on a crucial point
Francis Galiegue
fgaliegue at gmail.com
Mon Dec 14 15:24:11 UTC 2015
On Mon, Dec 14, 2015 at 4:17 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> On 14/12/2015 15:09, Francis Galiegue wrote:
>>
>> :
>> There is one more method in FileSystemProvider which is also making me
>> pause: .copy().
>>
>> Theoretically, it can be used if and only if two paths are from the
>> same provider; and in my case we get into the situation where even
>> that does not make any sense.
>>
>> If my two filesystems are different dropbox accounts for instance, I
>> cannot use the direct copy command from the dropbox sdk; I have to go
>> through a plain InputStream to OutputStream copy.
>>
> Is this a problem? Files.copy will delegate to the FileSystemProvider when
> the source and target are the same provider. It is up to the file system
> provider as to how the copy is done.
>
Yes, I know; I did exactly that.
Still, this is not very practical to having to replicate that
mechanism so many times...
But speaking of this same method again, here's another scenario:
* you have a fs wil more than one filestore;
* you have path p1 from filestore s1 which is read write;
* you have path p2 from filestore s2 which is read only;
* you try and Files.copy(p1, p2).
What is the exception here? It cannot be ReadOnlyFileSystemException
since at least one file store from the filesystem is read write...
--
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/fge/grappa
More information about the nio-dev
mailing list