<commit_before>package org.apache.flex.compiler.utils;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

import com.google.common.io.Files;


public class VF2JSProjectUtils
{

    private static File tempDir;
    
    public static final String createTempProject(String projectFilePath)
    {
        tempDir = Files.createTempDir();
        tempDir.deleteOnExit();
        
        String path = projectFilePath.substring(0, projectFilePath.lastIndexOf(File.separator));
        
        createTempProjectDir(new File(path).listFiles(), "");
        
        String fileName = projectFilePath.substring(projectFilePath.lastIndexOf(File.separator) + 1, projectFilePath.length());
        
        return tempDir.getAbsolutePath() + File.separator + fileName;
    }

    private static void createTempProjectDir(File[] files, String parentPath)
    {
        for (File file : files) 
        {
            if (file.isDirectory()) 
            {
                String path = parentPath + File.separator + file.getName(); 
                
                new File(tempDir + File.separator + path).mkdirs();

                createTempProjectDir(file.listFiles(), path);
            } 
            else 
            {
                String fileName = file.getName();

                if (fileName.contains(".") && fileName.charAt(0) != '.')
                {
                    String extension = fileName.substring(fileName.lastIndexOf("."), fileName.length());
    
                    if (extension.equals(".mxml") || extension.equals(".as"))
                    {
                        File intermediateFile = file;
                        String tempFileName = fileName.substring(0, fileName.indexOf("."));
                        File targetDir = new File(tempDir + File.separator + parentPath);

                        System.out.println("NEWLOC " + targetDir.getAbsolutePath());
                        
                        File newFile = createTempFileWithVF2JSNamespace(intermediateFile, 
                                tempFileName, false, targetDir, extension);

                        System.out.println("NEWFILE " + newFile.getAbsolutePath());
                    }
                }
            }
        }
    }
    
    private static File createTempFileWithVF2JSNamespace(File intermediateFile,
            String tempFileName, boolean createTempFile, File targetDir,
            String extension)
    {
        File tempFile = null;
        <commit_msg>A bit of cleaning up.<commit_after>package org.apache.flex.compiler.utils;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

import com.google.common.io.Files;


public class VF2JSProjectUtils
{

    private static File tempDir;
    
    public static final String createTempProject(String projectFilePath)
    {
        tempDir = Files.createTempDir();
        tempDir.deleteOnExit();
        
        String path = projectFilePath.substring(0, projectFilePath.lastIndexOf(File.separator));
        
        createTempProjectDir(new File(path).listFiles(), "");
        
        String fileName = projectFilePath.substring(projectFilePath.lastIndexOf(File.separator) + 1, projectFilePath.length());
        
        return tempDir.getAbsolutePath() + File.separator + fileName;
    }

    private static void createTempProjectDir(File[] files, String parentPath)
    {
        for (File file : files) 
        {
            if (file.isDirectory()) 
            {
                String path = parentPath + File.separator + file.getName(); 
                
                new File(tempDir + File.separator + path).mkdirs();

                createTempProjectDir(file.listFiles(), path);
            } 
            else 
            {
                String fileName = file.getName();

                if (fileName.contains(".") && fileName.charAt(0) != '.')
                {
                    String extension = fileName.substring(fileName.lastIndexOf("."), fileName.length());
    
                    if (extension.equals(".mxml") || extension.equals(".as"))
                    {
                        File intermediateFile = file;
                        String tempFileName = fileName.substring(0, fileName.indexOf("."));
                        File targetDir = new File(tempDir + File.separator + parentPath);
                        
                        createTempFileWithVF2JSNamespace(intermediateFile, 
                                tempFileName, false, targetDir, extension);
                    }
                }
            }
        }
    }
    
    private static File createTempFileWithVF2JSNamespace(File intermediateFile,
            String tempFileName, boolean createTempFile, File targetDir,
            String extension)
    {
        File tempFile = null;
        
{'fraction_non_alphanumeric': 0.09572719802793755, 'fraction_numerical': 0.002875924404272802, 'mean_word_length': 1.7369308600337268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7392648', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1150, 'n_words': 236}