@@ -0,0 +1,1891 @@
+package org.beanmaker.util;%0A%0Aimport org.apache.commons.io.FileUtils;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Apublic class DbBeanFileFilenameFixes %7B%0A%0A    public static void replaceExtraDotsInInternalFilename(DbBeanFile dbBeanFile) throws IOException %7B%0A        replaceExtraDotsInInternalFilename(dbBeanFile, %22_%22);%0A    %7D%0A%0A    public static void replaceExtraDotsInInternalFilename(DbBeanFile dbBeanFile, String replacement) throws IOException %7B%0A        String%5B%5D parts = dbBeanFile.getOrigFilename().split(%22%5C%5C.%22);%0A        int length = parts.length;%0A        if (length %3C= 2)%0A            return;%0A%0A        StringBuilder newFilename = new StringBuilder();%0A        newFilename.append(parts%5B0%5D);%0A        for (int i = 1; i %3C length - 1; ++i)%0A            newFilename.append(replacement).append(parts%5Bi%5D);%0A        newFilename.append(%22.%22).append(parts%5Blength - 1%5D);%0A%0A        safeInternalRename(dbBeanFile, newFilename.toString());%0A    %7D%0A%0A    private static void safeInternalRename(DbBeanFile dbBeanFile, String newFilename) throws IOException %7B%0A        File oldFile = dbBeanFile.getFile();%0A        File newFile = new File(oldFile.getParentFile(), newFilename);%0A        FileUtils.copyFile(oldFile, newFile);%0A%0A        dbBeanFile.setOrigFilename(newFilename);%0A        dbBeanFile.updateDB();%0A%0A        FileUtils.deleteQuietly(oldFile);%0A    %7D%0A%0A    public static void replaceCharactersInInternalFilename(DbBeanFile dbBeanFile, String regex, String replacement) throws IOException %7B%0A        String%5B%5D parts = dbBeanFile.getOrigFilename().split(regex);%0A        int length = parts.length;%0A        if (length == 1)%0A            return;%0A%0A        StringBuilder newFilename = new StringBuilder();%0A        newFilename.append(parts%5B0%5D);%0A        for (int i = 1; i %3C length; ++i)%0A            newFilename.append(replacement).append(parts%5Bi%5D);%0A%0A        safeInternalRename(dbBeanFile, newFilename.toString());%0A    %7D%0A%7D%0A

Create helper class to manage DbBeanFile filenames