private List < SourceFile > findJavaScriptFiles ( ResourceCollection rc ) { List < SourceFile > files = new ArrayList <> ( ) ; Iterator < Resource > iter = rc . iterator ( ) ; while ( iter . hasNext ( ) ) { FileResource fr = ( FileResource ) iter . next ( ) ; // Construct path to file, relative to current working directory. java . nio . file . Path path = Paths . get ( "" ) . toAbsolutePath ( ) . relativize ( fr . getFile ( ) . toPath ( ) ) ; files . add ( SourceFile . fromPath ( path , Charset . forName ( encoding ) ) ) ; } return files ; }
Translates an Ant resource collection into the file list format that the compiler expects .