feat: Copy B2 CLI URL#17108
Conversation
|
|
dkocher
left a comment
There was a problem hiding this comment.
Please add a test case for the new URL format for files and directories in B2UrlProviderTest.
| else { | ||
| String key; | ||
| if(file.isDirectory()) { | ||
| key = PathRelativizer.relativize(container.getAbsolute(), file.getAbsolute()); |
There was a problem hiding this comment.
Use B2PathContainerService#getKey and strip the end .bzEmpty (B2PathContainerService.PLACEHOLDER)
| URIEncoder.encode(containerService.getKey(file))); | ||
| list.add(new DescriptiveUrl(download, DescriptiveUrl.Type.http, | ||
| MessageFormat.format(LocaleFactory.localizedString("{0} URL"), Scheme.https.name().toUpperCase(Locale.ROOT)))); | ||
| if(file.isFile() || file.isDirectory()) { |
There was a problem hiding this comment.
Move check for file type inside scope of handled types.
|
|
||
| public B2UrlProvider(final B2Session session) { | ||
| this.session = session; | ||
| this.containerService = session.getFeature(PathContainerService.class); |
There was a problem hiding this comment.
Revert this change as the pattern instantiating B2PathContainerService is present in all other features.
| if(types.contains(DescriptiveUrl.Type.provider)) { | ||
| final Path container = containerService.getContainer(file); | ||
| if(!file.isRoot()) { | ||
| String cliUrl; |


closes #17107
tests are missing