Closed purejava closed 6 years ago
Maven tests pass.
As gvfs-mount
was implemented as a wrapper around gio mount
for quite a while the fix should work for versions of gvfs before 1.37.2 as well.
gvfs-open
is deprecated too.
How are your naming conventions?
Should members, classes, constants etc. be renamed from gvfs
to gio
?
The MR should be complete now.
Thank you for the PR!
I'm not absolutely convinced that gio mount
is available on older platforms that Cryptomator 1.4.0 is going to support. Our rule of thumb is to support the ones that are supported by the latest JDK.
If you find references that gio mount
is available on Ubuntu Linux 16.04 - LTS and 17.04, I think the PR is fine. I would suggest to rename LinuxGvfsMounter
to LinuxGioMounter
though (including other references to gvfs if there are any).
Otherwise, I would suggest to create a new LinuxGioMounter
and leave the LinuxGvfsMounter
as it was before. And then add this new MounterStrategy
to the MounterModule
.
I'm not absolutely convinced that
gio mount
is available on older platforms that Cryptomator 1.4.0 is going to support. Our rule of thumb is to support the ones that are supported by the latest JDK.Thanks for pointing out the rule of thumb.
If you find references that
gio mount
is available on Ubuntu Linux 16.04 - LTS and 17.04, I think the PR is fine.
And you are absolutely right. Digging through the history of gvfs
and glib
shows that the gio cmd tool was available with upstream version 2.49.3 of GLib. The change founds its way into Ubuntu with artful (17.10). The binary /usr/bin/gio
is available since then.
So at least for Ubuntu 16.04 LTS, which I was checking first, the gio command tool is not available and for this reason the gvfs -utils need to be used.
I would suggest to rename
LinuxGvfsMounter
toLinuxGioMounter
though (including other references to gvfs if there are any).Otherwise, I would suggest to create a new
LinuxGioMounter
and leave theLinuxGvfsMounter
as it was before. And then add this newMounterStrategy
to theMounterModule
.
Thank you for these suggestions. I go ahead and change the PR and add a check for both tools and depending on which one is available, one of the installed is used.
I propose this PR. It works with gvfs
versions 1.36.2-3 and 1.38.0+3+g7da3b0ba-1.
Finally I decided to go with a lightweight renaming, mostly to avoid changing the DEFAULT_GVFS_SCHEME
setting and keep backwards compatibility.
If something should be changed, please let me know :)
Edit: forgot to mention testing.
Otherwise, I would suggest to create a new LinuxGioMounter and leave the LinuxGvfsMounter as it was before. And then add this new MounterStrategy to the MounterModule.
I second that. Both Gvfs
and Gio
can extend an abstract VfsMountingStrategy
.
That way we have less if/else in the code and distinguish solely based on the polymorph isApplicable
method. The preferred mounter is then chosen via the order in which they are added to the list of available mounters in MounterModule
.
I second that. Both
Gvfs
andGio
can extend an abstractVfsMountingStrategy
.That way we have less if/else in the code and distinguish solely based on the polymorph
isApplicable
method. The preferred mounter is then chosen via the order in which they are added to the list of available mounters inMounterModule
.
Here we go.
I tested the change with gvfs
versions 1.36.2-3 and 1.38.0+3+g7da3b0ba-1 again.
Further I simulated missing gio
for Ubuntu 16.04 LTS. It's using the LinuxGvfsMounter
in that case as expected.
Can you make MountImpl protected, since this class name is also used by other Mounters within the same package?
Thanks @overheadhunter for the review and the hint! I'll add a commit with that improvement.
gvfs-mount has been replaced by gio mount in gvfs 1.37.2 gio mount provides the same functionality