com.hibegin.http.server.util.NativeImageUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simplewebserver Show documentation
Show all versions of simplewebserver Show documentation
Simple, flexible, less dependent, more extended. Less memory footprint, can quickly build Web project.
Can quickly run embedded, Android devices
package com.hibegin.http.server.util;
import com.hibegin.common.util.LoggerUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;
import java.util.logging.Logger;
public class NativeImageUtils {
private static final Logger LOGGER = LoggerUtil.getLogger(NativeImageUtils.class);
public static void doLoopResourceLoad(File[] files, String basePath, String uriStart) {
if (Objects.isNull(files)) {
return;
}
for (File file : files) {
if (file.isDirectory()) {
doLoopResourceLoad(file.listFiles(), basePath, uriStart);
} else {
String binPath = file.toString().substring(basePath.length());
String rFileName = uriStart + binPath.replace("\\", "/");
try (InputStream inputStream = NativeImageUtils.class.getResourceAsStream(rFileName)) {
if (Objects.nonNull(inputStream)) {
LOGGER.info("Native image add filename " + rFileName);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy