Skip to content

Commit

Permalink
Fix path argument to include default path set.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed May 6, 2024
1 parent 52a702c commit da16a60
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public DescriptiveUrl toDownloadUrl(final Path file, final Sharee sharee, final
final Host bookmark = session.getHost();
final StringBuilder request = new StringBuilder(String.format("https://%s%s/apps/files_sharing/api/v1/shares?path=%s&shareType=%d&shareWith=%s",
bookmark.getHostname(), new NextcloudHomeFeature(bookmark).find(NextcloudHomeFeature.Context.ocs).getAbsolute(),
URIEncoder.encode(PathRelativizer.relativize(new NextcloudHomeFeature(bookmark).find(NextcloudHomeFeature.Context.files).getAbsolute(), file.getAbsolute())),
URIEncoder.encode(PathRelativizer.relativize(NextcloudHomeFeature.Context.files.home(bookmark).find().getAbsolute(), file.getAbsolute())),
Sharee.world.equals(sharee) ? SHARE_TYPE_PUBLIC_LINK : SHARE_TYPE_USER,
Sharee.world.equals(sharee) ? StringUtils.EMPTY : sharee.getIdentifier()
));
Expand Down Expand Up @@ -153,7 +153,7 @@ public DescriptiveUrl toUploadUrl(final Path file, final Sharee sharee, final Ob
final Host bookmark = session.getHost();
final StringBuilder request = new StringBuilder(String.format("https://%s%s/apps/files_sharing/api/v1/shares?path=%s&shareType=%d&permissions=%d",
bookmark.getHostname(), new NextcloudHomeFeature(bookmark).find(NextcloudHomeFeature.Context.ocs).getAbsolute(),
URIEncoder.encode(PathRelativizer.relativize(new NextcloudHomeFeature(bookmark).find(NextcloudHomeFeature.Context.files).getAbsolute(), file.getAbsolute())),
URIEncoder.encode(PathRelativizer.relativize(NextcloudHomeFeature.Context.files.home(bookmark).find().getAbsolute(), file.getAbsolute())),
Sharee.world.equals(sharee) ? SHARE_TYPE_PUBLIC_LINK : SHARE_TYPE_USER,
SHARE_PERMISSIONS_CREATE
));
Expand Down

0 comments on commit da16a60

Please sign in to comment.