Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.jetty.ee9.servlet.ServletContextHandler;
import org.eclipse.jetty.ee9.servlet.ServletHolder;
import org.eclipse.jetty.io.RuntimeIOException;
import java.io.UncheckedIOException;
import org.eclipse.jetty.server.Server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -146,7 +146,7 @@ public void start() throws Exception {
}
attempts++;
if (attempts > 10) {
throw new RuntimeIOException("Failed to start after multiple attempts");
throw new UncheckedIOException(new IOException("Failed to start after multiple attempts"));
}
}
logger.info("Started listening on {}:{} ({})", host, port, this);
Expand All @@ -169,7 +169,7 @@ public void stop() {
}
attempts++;
if (attempts > 10) {
throw new RuntimeIOException("Failed to stop after multiple attempts");
throw new UncheckedIOException(new IOException("Failed to stop after multiple attempts"));
}
}
logger.info("Stopped listening on {}:{} ({})", host, port, this);
Expand Down
16 changes: 11 additions & 5 deletions logzio-sender-test/src/main/java/io/logz/test/TestEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ public static File createTempDirectory() {
+buildDirSubString+" in the following classpath: "+classPath));

try {
FileAttribute<Set<PosixFilePermission>> fileAttributes = PosixFilePermissions.asFileAttribute(EnumSet
.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE,
GROUP_READ, GROUP_EXECUTE, GROUP_WRITE,
OTHERS_EXECUTE, OTHERS_READ, OTHERS_WRITE));
return Files.createTempDirectory(buildDir.toPath(), "", fileAttributes).toFile();
boolean isPosixSupported = java.nio.file.FileSystems.getDefault().supportedFileAttributeViews().contains("posix");

if (isPosixSupported) {
FileAttribute<Set<PosixFilePermission>> fileAttributes = PosixFilePermissions.asFileAttribute(EnumSet
.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE,
GROUP_READ, GROUP_EXECUTE, GROUP_WRITE,
OTHERS_EXECUTE, OTHERS_READ, OTHERS_WRITE));
return Files.createTempDirectory(buildDir.toPath(), "", fileAttributes).toFile();
} else {
return Files.createTempDirectory(buildDir.toPath(), "").toFile();
}
} catch (IOException e) {
throw new RuntimeException("Failed creating temp directory in "+buildDir.getAbsolutePath(), e);
}
Expand Down