-
-
Notifications
You must be signed in to change notification settings - Fork 303
feat: Copy B2 CLI URL #17108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Copy B2 CLI URL #17108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move check for file type inside scope of handled types.
private final B2Session session; | ||
|
||
public B2UrlProvider(final B2Session session) { | ||
this.session = session; | ||
this.containerService = session.getFeature(PathContainerService.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign final
.
closes #17107
tests are missing