Skip to content

Commit

Permalink
Fix for transfer min size and Java warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw429s committed Mar 6, 2024
1 parent a3512ac commit 5341ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/main/java/runwar/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.management.ManagementFactory;
import java.lang.reflect.Method;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
Expand All @@ -34,6 +33,8 @@
import org.xnio.Option;
import org.xnio.OptionMap;

import com.apple.eawt.Application;

import io.undertow.Undertow;
import io.undertow.server.DefaultByteBufferPool;
import io.undertow.server.HandlerWrapper;
Expand Down Expand Up @@ -258,11 +259,7 @@ public synchronized void startServer(final ServerOptions options) throws Excepti
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("-Xdock:name", processName);
try {
Class<?> appClass = Class.forName("com.apple.eawt.Application");
Method getAppMethod = appClass.getMethod("getApplication");
Object appInstance = getAppMethod.invoke(null);
Method dockMethod = appInstance.getClass().getMethod("setDockIconImage", java.awt.Image.class);
dockMethod.invoke(appInstance, dockIcon);
Application.getApplication().setDockIconImage(dockIcon);
} catch (Exception e) {
LOG.warn(" Error setting dock icon image", e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/runwar/options/ConfigParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ private void parseOptions() {
// issues as detailed here:
// https://issues.redhat.com/browse/UNDERTOW-584
if (siteConfig.hasOption("sendFileMinSizeKB")) {
site.transferMinSize(Long.valueOf(siteConfig.getOptionValue("transferMinSize")) * 1024);
site.transferMinSize(Long.valueOf(siteConfig.getOptionValue("sendFileMinSizeKB")) * 1024);
}

if (siteConfig.hasOption("GZipEnable")) {
Expand Down

0 comments on commit 5341ae8

Please sign in to comment.