Conversation
| private String parseLocalUrl(final String url) { | ||
| return databaseDirectory + url.replaceFirst("file://", ""); | ||
| if(url.startsWith(LOCAL_PREFIX + "//")) { | ||
| return url.replaceFirst(LOCAL_PREFIX + "//", "/"); |
There was a problem hiding this comment.
This forces the path tp be absolute, because it prefix the path with /. Is this wanted or a bug?
There was a problem hiding this comment.
The paths are supposed to be absolute. The intention is to not rely on the current work-directory. Any not-absolute path would always be relative to the CWD. The URL without the LOCAL_PREFIX is still supported and allows to connect to a db relative to the database directory.
|
|
||
| @Test | ||
| public void testDropCreateWithLocalUrl() throws IOException { | ||
| String localUrl = "local:/" + absoluteDBPath + "/" + DB_NAME; |
There was a problem hiding this comment.
Are you prefixing with local:/ because the absolute path already starts with /?
|
The build-error is: Is it possible that the test uses a JDK version not supported by Gremlin? I cannot see any cause in my small coding additions that might be responsible for this kind of error. |
|
Merged, thanks @gfinger ! |
…6.1 to 3.6.2 [skip ci] Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.6.1 to 3.6.2. Release notes *Sourced from [org.apache.maven.plugins:maven-shade-plugin's releases](https://github.com/apache/maven-shade-plugin/releases).* > 3.6.2 > ----- > > 🐛 Bug Fixes > ----------- > > * Bug: Extra JARs and Artifacts were not subjected to filtering ([#785](https://redirect.github.com/apache/maven-shade-plugin/pull/785)) [`@cstamas`](https://github.com/cstamas) > > 👻 Maintenance > ------------- > > * Drop excessive dependencies ([#786](https://redirect.github.com/apache/maven-shade-plugin/pull/786)) [`@cstamas`](https://github.com/cstamas) > * chore: remove junit3 reference ([#762](https://redirect.github.com/apache/maven-shade-plugin/pull/762)) [`@sparsick`](https://github.com/sparsick) > * Exclude Java 25 ([#773](https://redirect.github.com/apache/maven-shade-plugin/pull/773)) [`@slachiewicz`](https://github.com/slachiewicz) > * Update site descriptor, use site configuration from parent ([#755](https://redirect.github.com/apache/maven-shade-plugin/pull/755)) [`@slawekjaranowski`](https://github.com/slawekjaranowski) > > 📦 Dependency updates > -------------------- > > * Drop unneeded dependencies ([#788](https://redirect.github.com/apache/maven-shade-plugin/pull/788)) [`@cstamas`](https://github.com/cstamas) > * Update to parent POM v 47 ([#781](https://redirect.github.com/apache/maven-shade-plugin/pull/781)) [`@Bukama`](https://github.com/Bukama) > * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.5.0 to 3.5.1 ([#782](https://redirect.github.com/apache/maven-shade-plugin/pull/782)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump org.codehaus.mojo:mrm-maven-plugin from 1.7.0 to 1.7.1 ([#780](https://redirect.github.com/apache/maven-shade-plugin/pull/780)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.4.0 to 3.5.0 ([#778](https://redirect.github.com/apache/maven-shade-plugin/pull/778)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump asmVersion from 9.9 to 9.9.1 ([#774](https://redirect.github.com/apache/maven-shade-plugin/pull/774)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Update invoker plugin to 3.9.1 to Support Java 25 ([#769](https://redirect.github.com/apache/maven-shade-plugin/pull/769)) [`@Bukama`](https://github.com/Bukama) > * Bump asmVersion from 9.8 to 9.9 ([#761](https://redirect.github.com/apache/maven-shade-plugin/pull/761)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump org.xmlunit:xmlunit-legacy from 2.10.3 to 2.11.0 ([#763](https://redirect.github.com/apache/maven-shade-plugin/pull/763)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump org.apache.maven.plugin-tools:maven-plugin-annotations from 3.15.1 to 3.15.2 ([#764](https://redirect.github.com/apache/maven-shade-plugin/pull/764)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.3.0 to 3.4.0 ([#768](https://redirect.github.com/apache/maven-shade-plugin/pull/768)) @[dependabot[bot]](https://github.com/apps/dependabot) > * Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 3.6.0 ([#758](https://redirect.github.com/apache/maven-shade-plugin/pull/758)) @[dependabot[bot]](https://github.com/apps/dependabot) Commits * [`ad8de59`](apache/maven-shade-plugin@ad8de59) [maven-release-plugin] prepare release maven-shade-plugin-3.6.2 * [`8eb19dc`](apache/maven-shade-plugin@8eb19dc) Drop unneeded dependencies ([#788](https://redirect.github.com/apache/maven-shade-plugin/issues/788)) * [`397b2cd`](apache/maven-shade-plugin@397b2cd) Drop excessive dependencies ([#786](https://redirect.github.com/apache/maven-shade-plugin/issues/786)) * [`eca6398`](apache/maven-shade-plugin@eca6398) Bug: Extra JARs and Artifacts were not subjected to filtering ([#785](https://redirect.github.com/apache/maven-shade-plugin/issues/785)) * [`7edce17`](apache/maven-shade-plugin@7edce17) Update to parent POM v 47 ([#781](https://redirect.github.com/apache/maven-shade-plugin/issues/781)) * [`3171a34`](apache/maven-shade-plugin@3171a34) Mockito improvements ([#783](https://redirect.github.com/apache/maven-shade-plugin/issues/783)) * [`678844b`](apache/maven-shade-plugin@678844b) Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness ([#782](https://redirect.github.com/apache/maven-shade-plugin/issues/782)) * [`73ec909`](apache/maven-shade-plugin@73ec909) Bump org.codehaus.mojo:mrm-maven-plugin from 1.7.0 to 1.7.1 ([#780](https://redirect.github.com/apache/maven-shade-plugin/issues/780)) * [`5f7a877`](apache/maven-shade-plugin@5f7a877) Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness ([#778](https://redirect.github.com/apache/maven-shade-plugin/issues/778)) * [`73c5247`](apache/maven-shade-plugin@73c5247) chore: remove junit3 reference ([#762](https://redirect.github.com/apache/maven-shade-plugin/issues/762)) * Additional commits viewable in [compare view](apache/maven-shade-plugin@maven-shade-plugin-3.6.1...maven-shade-plugin-3.6.2) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
What does this PR do?
A local URL like :
local:<absolutePathToDB>/DBcan be used within the Console to connect to a local DB, to create and drop it.Motivation
It should be possible to use the Console not relying on the current work-directory. It might also be advantageous not to depend on a global setting like when using the
-Darcadedb.server.databaseDirectoryparameter at startup of the console.Related issues
Introduction of the
-Darcadedb.server.databaseDirectoryparameter for the Console.Additional Notes
The commit also contains Unit Tests for the local connect, as well as a test whether the local URL can also be used with the
CREATE DBand theDROP DBcommands.I used JDK 19 for compiling and testing, but the code is compatible with Java 8.
Checklist
mvn clean packagecommand