private File getTargetFile ( File sourceFile , OutputFormat selectedOutputFormat ) throws IOException { File sourceDirectory = getSourceDirectory ( ) ; String relativePath = StringUtils . substringAfter ( sourceFile . getAbsolutePath ( ) , sourceDirectory . getAbsolutePath ( ) ) ; String relativeTargetPath = FileUtils . removeExtension ( relativePath ) + "." + selectedOutputFormat . getFileExtension ( ) ; File jsonFile = new File ( getGeneratedResourcesFolder ( ) . getPath ( ) + relativeTargetPath ) ; jsonFile = jsonFile . getCanonicalFile ( ) ; File parentDirectory = jsonFile . getParentFile ( ) ; if ( ! parentDirectory . exists ( ) ) { parentDirectory . mkdirs ( ) ; buildContext . refresh ( parentDirectory ) ; } return jsonFile ; }
Get the JSON file for source file .