Github user uschindler commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/74#discussion_r76740913
--- Diff:
solr/core/src/java/org/apache/solr/core/backup/repository/LocalFileSystemRepository.java
---
@@ -58,21 +59,28 @@ public void init(NamedList args) {
}
@Override
- public URI createURI(String... pathComponents) {
- Preconditions.checkArgument(pathComponents.length > 0);
-
- String basePath = Preconditions.checkNotNull(pathComponents[0]);
- // Note the URI.getPath() invocation on Windows platform generates an
invalid URI.
- // Refer to
http://stackoverflow.com/questions/9834776/java-nio-file-path-issue
- // Since the caller may have used this method to generate the string
representation
- // for the pathComponents, we implement a work-around specifically for
Windows platform
- // to remove the leading '/' character.
- if (Constants.WINDOWS) {
- basePath = basePath.replaceFirst("^/(.:/)", "$1");
+ public URI createURI(String location) {
+ Preconditions.checkNotNull(location);
+
+ URI result = null;
+ try {
--- End diff --
Nice. This is exactly as I proposed. So people can use both URIs with a
file: or just a plain path. URI.isAbsolute() returns false, if scheme ("file:")
is missing:
<https://docs.oracle.com/javase/7/docs/api/java/net/URI.html#isAbsolute()> "A
URI is absolute if, and only if, it has a scheme component."
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]