private static void initializeJavaSourceArtifacts ( ) throws DataAccessException , IOException , CachingException { logger . info ( "Initializing Java source assets..." ) ; long before = System . currentTimeMillis ( ) ; for ( Asset javaSource : AssetCache . getAssets ( Asset . JAVA ) ) { Package pkg = PackageCache . getAssetPackage ( javaSource . getId ( ) ) ; String packageName = pkg == null ? null : JavaNaming . getValidPackageName ( pkg . getName ( ) ) ; String className = JavaNaming . getValidClassName ( javaSource . getName ( ) ) ; File dir = createNeededDirs ( packageName ) ; File file = new File ( dir + "/" + className + ".java" ) ; if ( file . exists ( ) ) file . delete ( ) ; String javaCode = javaSource . getStringContent ( ) ; if ( javaCode != null ) { javaCode = doCompatibilityCodeSubstitutions ( packageName + "." + className , javaCode ) ; FileWriter writer = new FileWriter ( file ) ; writer . write ( javaCode ) ; writer . close ( ) ; } } if ( logger . isDebugEnabled ( ) ) logger . debug ( "Time to initialize Java source assets: " + ( System . currentTimeMillis ( ) - before ) + " ms" ) ; }
Writes the java - language assets into the temporary directory . This is only needed for compilation dependencies .