Dave Jarvis' Repositories

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

Removes unused functionality

AuthorDaveJarvis <email>
Date2022-12-17 18:13:51 GMT-0800
Commitc6a88c8e0c8cfd7f0840095b3248d7dc488b68cf
Parente2f7e1e
Delta1 line added, 39 lines removed, 38-line decrease
src/main/java/com/keenwrite/preview/SvgReplacedElementFactory.java
import static com.keenwrite.events.StatusEvent.clue;
-import static com.keenwrite.io.MediaType.IMAGE_SVG_XML;
import static com.keenwrite.io.downloads.DownloadManager.open;
import static com.keenwrite.preview.MathRenderer.MATH_RENDERER;
if( getProtocol( source ).isHttp() ) {
try( final var response = open( source ) ) {
- if( response.isMediaType( IMAGE_SVG_XML ) ) {
+ if( response.isSvg() ) {
// Attempt to rasterize SVG depending on URL resource content.
raster = rasterize(
src/main/java/com/keenwrite/io/downloads/InvalidMediaTypeException.java
-package com.keenwrite.io.downloads;
-
-import com.keenwrite.io.MediaType;
-
-import java.io.IOException;
-import java.net.URL;
-
-/**
- * Indicates that the requested media type for a resource was incongruent
- * with that requested for download.
- */
-public class InvalidMediaTypeException extends IOException {
- private final URL mUrl;
- private final MediaType mMediaType;
-
- /**
- * Creates a new exception that indicates the resource and its media type
- * were incongruent.
- *
- * @param url The resource that was requested to be downloaded.
- * @param type The required media type to be downloaded.
- */
- public InvalidMediaTypeException( final URL url, final MediaType type ) {
- super( url.toString() );
-
- mUrl = url;
- mMediaType = type;
- }
-
- public URL getUrl() {
- return mUrl;
- }
-
- public MediaType getMediaType() {
- return mMediaType;
- }
-}