在Windows7环境中,是否可以在java deployment.properties文件中执行以下操作:
deployment.user.security.trusted.certs=H\:\\hiddendir\\trusted.certs但是,当它创建hiddendir时,该目录是隐藏的
例如,在Linux上,你可以在H:.hiddendir前面加一个点。
在Windows 7上有没有类似的东西?
发布于 2015-04-17 00:33:32
假设您在本机环境中严格使用此方法,则可以将属性与Runtime.exec()方法一起使用。Java API中没有任何东西可以单独使用。
举个例子:
Process p = Runtime.getRuntime().exec("attrib +h " + src.getPath());你可以参考attrib。
但是,如果您不了解本机环境,则可以创建操作系统检查以提供不同的隐藏文件属性。
即。
private static String OS = System.getProperty("os.name").toLowerCase();
public static boolean isWindows() {
return (OS.indexOf("win") >= 0);
}
public static void main(String[] args) {
if isWindows(){
//then do
}
}https://stackoverflow.com/questions/29680606
复制相似问题