The Java implementation will output all the file paths in the specified folder to the specified file as a parameterized file for use with the LR script
Import Java.io.bufferedreader;import Java.io.bufferedwriter;import java.io.file;import Java.io.fileoutputstream;import Java.io.inputstreamreader;import Java.io.OutputStreamWriter; Public classGetFileName { Public Static voidMain (string[] args) throws Exception {//TODO auto-generated Method StubBufferedReader br =NewBufferedReader (NewInputStreamReader (System.inch )); //Java.io.InputStreamReader inherits the reader classString Read =NULL; System. out. Print ("Enter folder:"); Read=Br.readline (); BufferedReader Br01=NewBufferedReader (NewInputStreamReader (System.inch )); //Java.io.InputStreamReader inherits the reader classSystem. out. Print ("Output File:"); String Write=Br.readline (); FileOutputStream Fos=NewFileOutputStream (write); OutputStreamWriter OSW=Newoutputstreamwriter (FOS); BufferedWriter BW=NewBufferedWriter (OSW); File F=NewFile (read); String dir=F.getabsolutepath (); if(F.isdirectory ()) {string[] SS=f.list (); for(String s:ss) {bw.write (dir+"\\"+s); Bw.newline (); }} bw.flush (); Bw.close (); }}
The Java implementation will output all the file paths in the specified folder to the specified file as a parameterized file for use with the LR script