Hey guys,
Been playing around with the read/write files and have them working great. Thank you!
One thing that I'd like to do is get a list of all the txt files stored in file manager and be able to select them using an input statement...
ie. input "theTXTs", "enum", title: "All txt files stored locally", options: theTXTfiles, multiple:true ... etc
Was thinking the fileExists code would be the best way to do it but it doesn't seem that wildcards can be used in the file name (ie. *.txt) Was hoping that it would scroll through the files and be able to save the filename to a list.
Any ideas?
Thanks
File Exists Code
@Field static String fName = "*.txt"
Boolean fileExists(fName){
if(logEnable) log.debug "Checking to see if File Exists - ${fName}"
uri = "http://${location.hub.localIP}:8080/local/${fName}";
def params = [
uri: uri
]
try {
httpGet(params) { resp ->
if (resp != null){
if(logEnable) log.debug "File Exists! ${fName}"
// Add it to a file...
} else {
// do nothing
}
}
} catch (e) {
log.error e
}
}