Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Replace image filenames with relative path

AuthorDaveJarvis <email>
Date2020-10-04 13:27:40 GMT-0700
Commitd4c5dc96932b691c5993cccbf2ca9414a6aa4ad7
Parentb134618
Delta5 lines added, 8 lines removed, 3-line decrease
src/main/java/com/keenwrite/util/ProtocolResolver.java
*
* @param file Determine the protocol for this file.
- * @return The protocol for the given file.
+ * @return The protocol for the given file, or {@link ProtocolScheme#UNKNOWN}
+ * if the protocol cannot be determined.
*/
private static String getProtocol( final File file ) {
- String result;
-
try {
- result = file.toURI().toURL().getProtocol();
+ return file.toURI().toURL().getProtocol();
} catch( final MalformedURLException ex ) {
- // Value guaranteed to avoid identification as a standard protocol.
- result = UNKNOWN.toString();
+ // Return a protocol guaranteed to be undefined.
+ return UNKNOWN.toString();
}
-
- return result;
}
}