简体   繁体   English

从Deployment.properties创建隐藏目录

[英]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.

相关问题 Java系统级Deployment.properties - Java system level deployment.properties 是否有一个等效于Java Deployment.properties文件的Adobe? - Is there an Adobe equivalent to the Java deployment.properties file? 如何从Java方法临时替换tomcat的deploy.properties中的属性? - How to replace a property in the deployment.properties of tomcat temporarily from java method? 如何从Windows命令提示符修改Java控制面板选择(对应于deployment.properties文件)? - How to modify Java Control Panel selections (corresponding to deployment.properties file) from windows command prompt? 使用bat文件编辑Deployment.properties文件 - Editing Deployment.properties file using bat file 部署后从config.properties文件获取属性对象 - Getting Properties Object from config.properties file after deployment Appengine-部署隐藏文件夹 - Appengine - Deployment of hidden folder java-从活动目录查询扩展属性 - java - query extended properties from active directory Wildfly:从类路径目录中读取属性文件 - wildfly: reading properties file from classpath directory 如何从根目录加载属性文件? - How to load a properties file from the root directory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM