com.hibegin.common.util.EnvKit 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.common.util;
import java.io.File;
public class EnvKit {
private static final boolean ANDROID;
static {
boolean tmpFlag;
try {
Class.forName("android.app.Application");
tmpFlag = true;
} catch (ClassNotFoundException e) {
tmpFlag = false;
}
ANDROID = tmpFlag;
}
public static void savePid(String pidFile) {
File file = new File(pidFile);
if (file.exists()) {
file.delete();
}
long pid = Pid.get();
if (pid > 0) {
IOUtil.writeStrToFile(pid + "", file);
file.deleteOnExit();
}
}
public static boolean isAndroid() {
return ANDROID;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy