public List < String > getcurrentFsSnapshot ( State state ) { List < String > results = new ArrayList <> ( ) ; String path = getLsPattern ( state ) ; try { log . info ( "Running ls command with input " + path ) ; results = this . fsHelper . ls ( path ) ; for ( int i = 0 ; i < results . size ( ) ; i ++ ) { URI uri = new URI ( results . get ( i ) ) ; String filePath = uri . toString ( ) ; if ( ! uri . isAbsolute ( ) ) { File file = new File ( state . getProp ( ConfigurationKeys . SOURCE_FILEBASED_DATA_DIRECTORY ) , uri . toString ( ) ) ; filePath = file . getAbsolutePath ( ) ; } results . set ( i , filePath + this . splitPattern + this . fsHelper . getFileMTime ( filePath ) ) ; } } catch ( FileBasedHelperException | URISyntaxException e ) { log . error ( "Not able to fetch the filename/file modified time to " + e . getMessage ( ) + " will not pull any files" , e ) ; } return results ; }
This method is responsible for connecting to the source and taking a snapshot of the folder where the data is present it then returns a list of the files in String format