我在我的 Ant 脚本中使用 javascript 将运行时网络远程文件夹值作为输入传递。传递该值后,我发现输入文件夹路径是否存在。但我无法做到这一点。我的代码如下。
<script language="javascript">
<![CDATA[
importPackage(javax.io);
importPackage(javax.swing);
importPackage(java.lang);
var deployment_machine = project.getProperty("var2");
var deployment_machine = deployment_machine.substring(2,deployment_machine.indexOf("$")-2);
var optionPane = JOptionPane.showInputDialog( 'Deployment location for GatewayFW in ' + deployment_machine + '?', null );
var path = require('optionPane');
if (path.existsSync("/the/path")) {
// ...
}
if(!fso.FolderExists(optionPane))
{
var optionPane = JOptionPane.showInputDialog( 'Deployment location for GatewayFW in ?', deployment_machine );
}
else
{
project.setProperty('deploy_loc',optionPane);
}
]]>
</script>
</then>
<else>
<echo message="File need to check:- ${patch.path}/${patch.name}/GatewayFW_patch.zip is not exist"/>
</else>
`
任何人都可以帮我吗?