Skip to content
Snippets Groups Projects
Commit c04de39e authored by loki der quaeler's avatar loki der quaeler Committed by loki der quaeler
Browse files

Accomodating Windows full paths including drive letter - #424

. Added regex-deciphering comment
. Including the case where someone uses lowercase when citing their drive letter

[Enhancement][Tools]
parent 0ee1dc9c
No related branches found
No related tags found
No related merge requests found
...@@ -27,8 +27,11 @@ public interface FilenameToStream ...@@ -27,8 +27,11 @@ public interface FilenameToStream
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public static class TLAFile extends File { public static class TLAFile extends File {
// The following regex is concerned with determining whether the provided 'parent' string to our
// parent/child constructor looks like the start of a legal absolute file path potentially including
// a drive letter.
private static final String ROOT_PATH_REGEX private static final String ROOT_PATH_REGEX
= "^([A-Z]+:)?" + ((File.separatorChar == '\\') ? "\\\\" : File.separator); = "^([a-zA-Z]+:)?" + ((File.separatorChar == '\\') ? "\\\\" : File.separator);
private static final Pattern ROOT_PATH_PATTERN = Pattern.compile(ROOT_PATH_REGEX); private static final Pattern ROOT_PATH_PATTERN = Pattern.compile(ROOT_PATH_REGEX);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment