0

I would like to be able to create a list ,array, of file names on a folder so that I can use PeopleCode to loop through them and delete files that match a pattern and are in a date range.

I'm pretty sure I have the last half of that, matching a pattern and in a date range, but I do not know how to get the list on remote servers. I can do it on our local servers, but not remote ones.

I had hoped that this would work: Local object &files = CreateJavaObject("java.io.File", SFO_DEL_FTP_AET.FTPDIRECTORY | "*.*"); But I don't think it is working.

Can somebody help me?

Thanks,

JPS

John
  • 11
  • 2
  • I sort of have this working but filtering things out is a nightmare. Does anybody know how to set a filter? It looks like this should work, but it fails: Local JavaObject &joFilter = CreateJavaObject("java.io.FilenameFilter"); &joFilter.setfilenamefilter = SFO_DEL_FTP_AET.FILENAME; – John May 10 '21 at 22:47

1 Answers1

0

You can use Java to access/modify the files in a directory. Try:

Local JavaObject instead of Local object

We created a PS component to view, upload, and delete files in an App Server directory. You can see how we did it here:

https://github.com/cy2hq/PeopleSoft-Directory-Viewer

cuda
  • 138
  • 4
  • Thanks, but I am trying to do this on remote servers. I already can do it using PeopleCode to get the list of files and the java to delete. What I need to be able to do is to list them on remote servers, not ours. – John May 07 '21 at 22:45
  • Missed the remote, part. If it is a mounted/mapped network directory/drive, sure it will work. FTP, no. – cuda May 08 '21 at 02:50