@Test public void uriParsingTests() { assertThat(Events.toFileUri(null)).isNull(); assertThat(Events.toFileUri("")).isNull(); assertThat(Events.toFileUri("a/b/c")).isEqualTo(URI.create("file: assertThat(Events.toFileUri("/a/b/c")).isEqualTo(URI.create("file: assertThat(Events.toFileUri("a\\b\\c")).isEqualTo(URI.create("file: assertThat(Events.toFileUri("[abc]")).isNull(); }
static URI toFileUri(final String source) { if (source == null || source.isEmpty()) { return null; } try { final String escaped = RedURI.URI_SPECIAL_CHARS_ESCAPER.escape(source); return new URI("file: } catch (final URISyntaxException e) { return null; } }
Events { static URI toFileUri(final String source) { if (source == null || source.isEmpty()) { return null; } try { final String escaped = RedURI.URI_SPECIAL_CHARS_ESCAPER.escape(source); return new URI("file: } catch (final URISyntaxException e) { return null; } } }
Events { static URI toFileUri(final String source) { if (source == null || source.isEmpty()) { return null; } try { final String escaped = RedURI.URI_SPECIAL_CHARS_ESCAPER.escape(source); return new URI("file: } catch (final URISyntaxException e) { return null; } }  }
Events { static URI toFileUri(final String source) { if (source == null || source.isEmpty()) { return null; } try { final String escaped = RedURI.URI_SPECIAL_CHARS_ESCAPER.escape(source); return new URI("file: } catch (final URISyntaxException e) { return null; } }   }
Events { static URI toFileUri(final String source) { if (source == null || source.isEmpty()) { return null; } try { final String escaped = RedURI.URI_SPECIAL_CHARS_ESCAPER.escape(source); return new URI("file: } catch (final URISyntaxException e) { return null; } }    }