对于这个Netbeans项目:
.
├── build.xml
├── manifest.mf
├── nbproject
│ ├── build-impl.xml
│ ├── genfiles.properties
│ ├── groovy-build.xml
│ ├── private
│ │ └── private.properties
│ ├── project.properties
│ └── project.xml
└── src
├── Config1.groovy
└── net
└── bounceme
└── mordor
└── groovy
└── file_ops
└── NewGroovyScript.groovy
8 directories, 10 files
foo.properties
的标准位置或路径是什么,以便它can be easily picked up?在src
?
答案 0 :(得分:1)
您应该能够将其与NewGroovyScript.groovy
类文件放在同一个文件夹中,然后执行:
Properties p = NewGroovyScript.class.getResource('foo.properties').withInputStream { s ->
Properties properties = new Properties()
properties.load(s)
properties
}