-
Notifications
You must be signed in to change notification settings - Fork 29
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
Reduce Common Usage between APOC Extended and APOC Core #706
Open
gem-neo4j
wants to merge
1
commit into
dev
Choose a base branch
from
dev_reduce_common_reliance
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem-neo4j
force-pushed
the
dev_reduce_common_reliance
branch
3 times, most recently
from
December 17, 2024 07:59
ba3df7e
to
9f4e08f
Compare
gem-neo4j
force-pushed
the
dev_reduce_common_reliance
branch
5 times, most recently
from
December 20, 2024 08:00
3e7d15f
to
b7ad46d
Compare
gem-neo4j
force-pushed
the
dev_reduce_common_reliance
branch
from
December 20, 2024 08:34
b7ad46d
to
ca74218
Compare
JoelBergstrand
approved these changes
Jan 8, 2025
Comment on lines
+19
to
+21
package apoc.util; | ||
|
||
public class CoreUtil {} |
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.
Why is this needed?
Comment on lines
+344
to
+377
public static boolean isFile(String fileName) { | ||
return from(fileName) == SupportedProtocols.file; | ||
} | ||
|
||
public static SupportedProtocols from(URL url) { | ||
return FileUtils.of(url.getProtocol()); | ||
} | ||
|
||
public static SupportedProtocols from(String source) { | ||
try { | ||
final URL url = new URL(source); | ||
return from(url); | ||
} catch (MalformedURLException e) { | ||
if (!e.getMessage().contains("no protocol")) { | ||
try { | ||
// in case new URL(source) throw e.g. unknown protocol: hdfs, because of missing jar, | ||
// we retrieve the related enum and throw the associated MissingDependencyException(..) | ||
// otherwise we return unknown protocol: yyyyy | ||
return SupportedProtocols.valueOf(new URI(source).getScheme()); | ||
} catch (Exception ignored) { | ||
} | ||
|
||
// in case a Windows user write an url like `C:/User/...` | ||
if (e.getMessage().contains("unknown protocol") && Util.isWindows()) { | ||
throw new RuntimeException(e.getMessage() | ||
+ "\n Please note that for Windows absolute paths they have to be explicit by prepending `file:` or supplied without the drive, " | ||
+ "\n e.g. `file:C:/my/path/file` or `/my/path/file`, instead of `C:/my/path/file`"); | ||
} | ||
throw new RuntimeException(e); | ||
} | ||
return SupportedProtocols.file; | ||
} | ||
} | ||
|
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.
Is this new or moved from somewhere else?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.