[英]Create a hidden directory from deployment.properties
Is it possible in a Windows 7 environment to do the following in your java deployment.properties file: 在Windows 7环境中,是否可以在java deployment.properties文件中执行以下操作:
deployment.user.security.trusted.certs=H\:\\hiddendir\\trusted.certs
but when it creates hiddendir the directory is hidden 但是当它创建hiddendir时,目录是隐藏的
eg on Linux you could put a dot in front H:\\.hiddendir 例如,在Linux上,您可以在H:\\。hiddendir前面加一个点
is there anything similar on Windows 7 Windows 7上是否有类似的东西
Assuming that you are using this strictly on a native environment you can use an attribute with the Runtime.exec() method. 假设您严格在本机环境中使用此属性,则可以将属性与Runtime.exec()方法一起使用。 There is nothing solely in the Java API which could be used.
仅Java API中没有可以使用的东西。
An example: 一个例子:
Process p = Runtime.getRuntime().exec("attrib +h " + src.getPath());
You can refer to attrib . 您可以参考attrib 。
However, if you are unaware of the native environment, you can create an OS check to provide different hidden file properties. 但是,如果您不知道本机环境,则可以创建OS检查以提供不同的隐藏文件属性。
ie. 即。
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
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.