remove commons-io since we already have guava

This commit is contained in:
Athou
2024-06-12 17:17:54 +02:00
parent f99fe57695
commit 232658b934
3 changed files with 5 additions and 10 deletions

View File

@@ -2,10 +2,9 @@ package com.commafeed.backend.service;
import java.io.IOException;
import java.time.Instant;
import java.util.Objects;
import java.util.Set;
import org.apache.commons.io.IOUtils;
import com.commafeed.backend.Digests;
import com.commafeed.backend.dao.FeedDAO;
import com.commafeed.backend.favicon.AbstractFaviconFetcher;
@@ -13,6 +12,7 @@ import com.commafeed.backend.favicon.Favicon;
import com.commafeed.backend.feed.FeedUtils;
import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.Models;
import com.google.common.io.Resources;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
@@ -31,7 +31,8 @@ public class FeedService {
this.faviconFetchers = faviconFetchers;
try {
defaultFavicon = new Favicon(IOUtils.toByteArray(getClass().getResource("/images/default_favicon.gif")), "image/gif");
defaultFavicon = new Favicon(
Resources.toByteArray(Objects.requireNonNull(getClass().getResource("/images/default_favicon.gif"))), "image/gif");
} catch (IOException e) {
throw new RuntimeException("could not load default favicon", e);
}

View File

@@ -11,7 +11,6 @@ import java.util.Date;
import java.util.List;
import java.util.Objects;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.glassfish.jersey.media.multipart.FormDataParam;
@@ -524,7 +523,7 @@ public class FeedREST {
return Response.status(Status.FORBIDDEN).entity("Import is disabled for the demo account").build();
}
try {
String opml = IOUtils.toString(input, StandardCharsets.UTF_8);
String opml = new String(input.readAllBytes(), StandardCharsets.UTF_8);
opmlImporter.importOpml(user, opml);
} catch (Exception e) {
log.error(e.getMessage(), e);