0

For this Netbeans project:

.
├── 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

what would the standard location, or path, for foo.properties so that it can be easily picked up? in src?

Community
  • 1
  • 1
Thufir
  • 8,216
  • 28
  • 125
  • 273

1 Answers1

1

You should be able to stick it in the same folder as your NewGroovyScript.groovy class file, then just do:

Properties p = NewGroovyScript.class.getResource('foo.properties').withInputStream { s ->
    Properties properties = new Properties()
    properties.load(s)
    properties
}
tim_yates
  • 167,322
  • 27
  • 342
  • 338