Dave Jarvis' Repositories

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

Replace hard-coded sigil with derived value for R Script preferences UI

AuthorDaveJarvis <email>
Date2020-12-30 11:03:49 GMT-0800
Commitd83a3df3def7367a39c5f100605fa29d5226b0ee
Parent80ef259
Delta15 lines added, 1 line removed, 14-line increase
src/main/resources/com/keenwrite/messages.properties
workspace.r.script.desc=Script runs prior to executing R statements within the document.
workspace.r.dir=Working Directory
-workspace.r.dir.desc=Value assigned to $application.r.working.directory$ and usable in the startup script.
+workspace.r.dir.desc=Value assigned to {0}application.r.working.directory{1} and usable in the startup script.
workspace.r.dir.title=Directory
workspace.r.delimiter.began=Delimiter Prefix
src/main/java/com/keenwrite/io/MediaType.java
import java.io.File;
+import java.nio.file.Path;
import static com.keenwrite.io.MediaType.TypeName.*;
public static MediaType valueFrom( final File file ) {
return valueFrom( file.getName() );
+ }
+
+ /**
+ * Returns the {@link MediaType} associated with the path to a file.
+ *
+ * @param path Has a file name that may contain an extension associated with
+ * a known {@link MediaType}.
+ * @return {@link MediaType#UNDEFINED} if the extension has not been
+ * assigned, otherwise the {@link MediaType} associated with this
+ * {@link File}'s file name extension.
+ */
+ public static MediaType valueFrom( final Path path ) {
+ return valueFrom( path.toFile() );
}