-
Notifications
You must be signed in to change notification settings - Fork 62
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
add support for relative upload paths in DataStoreService #23
Conversation
sardine = new SardineImpl(httClientBuilder, user, pass); | ||
} | ||
|
||
private UriPrefixer getPrefixer() { | ||
if (prefixer == null) { | ||
final String webDAVUri = gdcService.getGdc().getLink("uploads").getLink(); | ||
prefixer = new UriPrefixer(webDAVUri); | ||
final String uriPrefix = StringUtils.isEmpty(URI.create(webDAVUri).getHost()) ? gdcHost + webDAVUri : webDAVUri; |
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.
what about protocol?
Maybe we should use HttpClient's |
I would go for UriBuilder, thanks ! |
well it seems UriBuilder can't bring anything useful, however here is the solution handling slahes corectly + test |
initJadler(); | ||
|
||
gdcService = mock(GdcService.class); | ||
storeService = new DataStoreService(HttpClientBuilder.create(), gdcService, "http://localhost:"+port(), "user", "pass"); |
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.
probably the port should be passed as an argument?
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.
I would prefere not, the DataStoreService doesn't need to know about gdc uri structure, it only needs to know whole uri to prefix the uploads when needed. I will rename the contructor argument and create it more correctly
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.
DataStoreServiceTest changed to integration test (DataStoreServiceIT)
734b64e
to
d7f29ab
Compare
one last thing: please write the commit message in the imperative mood |
d7f29ab
to
e981ddb
Compare
the link to uploads in Gdc, can be relative when the host is the same as gdcHost, added fallback to complete the relative path with gdcHost uri
e981ddb
to
1a61655
Compare
commit message is now in the imperative mood |
add support for relative upload paths in DataStoreService
No description provided.