@Test @Ignore public void migrateDirectory() throws PlatoException, FileNotFoundException{ PlanMigrator migrator = new PlanMigrator(); File dir = new File("/home/kraxner/Documents/SCAPE/plan-problems"); File plans[] = dir.listFiles(); for (File plan : plans) { if (plan.isFile() && plan.getName().endsWith(".xml")) { String tempPath = dir.getAbsolutePath() + File.separator + plan.getName().substring(0, plan.getName().length()-4) + File.separator; File tempDir = new File(tempPath); tempDir.mkdirs(); List<String> appliedTransformations = new ArrayList<String>(); String currentVersionData; try { currentVersionData = migrator.getCurrentVersionData(new FileInputStream(plan), tempPath, appliedTransformations); File migratedFile = new File(currentVersionData); File outFile = new File("d: if (!migratedFile.renameTo(outFile)) { log.error("Failed to move file : " + currentVersionData); } } catch (Exception e) { log.error("failed to migrate file: " + plan.getName(), e); } } } }
public String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations) throws PlatoException { String originalFile = tempPath + "_original.xml"; try { FileUtils.writeToFile(in, new FileOutputStream(originalFile)); fileVersion = "xxx"; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(false); Digester d = new Digester(factory.newSAXParser()); d.setValidating(false); d.push(this); d.addSetProperties("*/projects", "version", "fileVersion"); d.addSetProperties("*/projects/project", "version", "fileVersion"); d.addSetProperties("*/project", "version", "fileVersion"); d.addSetProperties("plans", "version", "fileVersion"); InputStream inV = new FileInputStream(originalFile); d.parse(inV); inV.close(); String version = "1.0"; if (fileVersion != null) { version = fileVersion; } String fileTo = originalFile; String fileFrom = originalFile; boolean success = true; if ("xxx".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.3.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/Vxxx-to-V1.3.xsl"); appliedTransformations.add("Vxxx-to-V1.3.xsl"); version = "1.3"; } if (success && "1.3".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V1.3-to-V1.9.xsl"); appliedTransformations.add("V1.3-to-V1.9.xsl"); version = "1.9"; } if (success && "1.9".equals(version)) { version = "2.0"; } if (success && "2.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.0-to-V2.1.xsl"); appliedTransformations.add("V2.0-to-V2.1.xsl"); version = "2.1"; } if (success && "2.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.2".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.2-to-V3.0.0.xsl"); appliedTransformations.add("V2.1.2-to-V3.0.0.xsl"); version = "3.0.0"; } if (success && "3.0.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.0-to-V3.0.1.xsl"); appliedTransformations.add("V3.0.0-to-V3.0.1.xsl"); version = "3.0.1"; } if (success && "3.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.1-to-V3.9.0.xsl"); appliedTransformations.add("V3.0.1-to-V3.9.0.xsl"); version = "3.9.0"; } if (success && "3.9.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.0-to-V3.9.9.xsl"); appliedTransformations.add("V3.9.0-to-V3.9.9.xsl"); version = "3.9.9"; } if (success && "3.9.9".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.9-to-V4.0.1.xsl"); appliedTransformations.add("V3.9.9-to-V4.0.1.xsl"); version = "4.0.1"; } if (success && "4.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V4.0.1-to-V4.0.2.xsl"); appliedTransformations.add("V4.0.1-to-V4.0.2.xsl"); version = "4.0.2"; } if (success) { return fileTo; } else { return null; } } catch (Exception e) { throw new PlatoException("Failed to update plan to current version.", e); } }
PlanMigrator { public String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations) throws PlatoException { String originalFile = tempPath + "_original.xml"; try { FileUtils.writeToFile(in, new FileOutputStream(originalFile)); fileVersion = "xxx"; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(false); Digester d = new Digester(factory.newSAXParser()); d.setValidating(false); d.push(this); d.addSetProperties("*/projects", "version", "fileVersion"); d.addSetProperties("*/projects/project", "version", "fileVersion"); d.addSetProperties("*/project", "version", "fileVersion"); d.addSetProperties("plans", "version", "fileVersion"); InputStream inV = new FileInputStream(originalFile); d.parse(inV); inV.close(); String version = "1.0"; if (fileVersion != null) { version = fileVersion; } String fileTo = originalFile; String fileFrom = originalFile; boolean success = true; if ("xxx".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.3.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/Vxxx-to-V1.3.xsl"); appliedTransformations.add("Vxxx-to-V1.3.xsl"); version = "1.3"; } if (success && "1.3".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V1.3-to-V1.9.xsl"); appliedTransformations.add("V1.3-to-V1.9.xsl"); version = "1.9"; } if (success && "1.9".equals(version)) { version = "2.0"; } if (success && "2.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.0-to-V2.1.xsl"); appliedTransformations.add("V2.0-to-V2.1.xsl"); version = "2.1"; } if (success && "2.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.2".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.2-to-V3.0.0.xsl"); appliedTransformations.add("V2.1.2-to-V3.0.0.xsl"); version = "3.0.0"; } if (success && "3.0.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.0-to-V3.0.1.xsl"); appliedTransformations.add("V3.0.0-to-V3.0.1.xsl"); version = "3.0.1"; } if (success && "3.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.1-to-V3.9.0.xsl"); appliedTransformations.add("V3.0.1-to-V3.9.0.xsl"); version = "3.9.0"; } if (success && "3.9.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.0-to-V3.9.9.xsl"); appliedTransformations.add("V3.9.0-to-V3.9.9.xsl"); version = "3.9.9"; } if (success && "3.9.9".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.9-to-V4.0.1.xsl"); appliedTransformations.add("V3.9.9-to-V4.0.1.xsl"); version = "4.0.1"; } if (success && "4.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V4.0.1-to-V4.0.2.xsl"); appliedTransformations.add("V4.0.1-to-V4.0.2.xsl"); version = "4.0.2"; } if (success) { return fileTo; } else { return null; } } catch (Exception e) { throw new PlatoException("Failed to update plan to current version.", e); } } }
PlanMigrator { public String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations) throws PlatoException { String originalFile = tempPath + "_original.xml"; try { FileUtils.writeToFile(in, new FileOutputStream(originalFile)); fileVersion = "xxx"; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(false); Digester d = new Digester(factory.newSAXParser()); d.setValidating(false); d.push(this); d.addSetProperties("*/projects", "version", "fileVersion"); d.addSetProperties("*/projects/project", "version", "fileVersion"); d.addSetProperties("*/project", "version", "fileVersion"); d.addSetProperties("plans", "version", "fileVersion"); InputStream inV = new FileInputStream(originalFile); d.parse(inV); inV.close(); String version = "1.0"; if (fileVersion != null) { version = fileVersion; } String fileTo = originalFile; String fileFrom = originalFile; boolean success = true; if ("xxx".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.3.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/Vxxx-to-V1.3.xsl"); appliedTransformations.add("Vxxx-to-V1.3.xsl"); version = "1.3"; } if (success && "1.3".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V1.3-to-V1.9.xsl"); appliedTransformations.add("V1.3-to-V1.9.xsl"); version = "1.9"; } if (success && "1.9".equals(version)) { version = "2.0"; } if (success && "2.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.0-to-V2.1.xsl"); appliedTransformations.add("V2.0-to-V2.1.xsl"); version = "2.1"; } if (success && "2.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.2".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.2-to-V3.0.0.xsl"); appliedTransformations.add("V2.1.2-to-V3.0.0.xsl"); version = "3.0.0"; } if (success && "3.0.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.0-to-V3.0.1.xsl"); appliedTransformations.add("V3.0.0-to-V3.0.1.xsl"); version = "3.0.1"; } if (success && "3.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.1-to-V3.9.0.xsl"); appliedTransformations.add("V3.0.1-to-V3.9.0.xsl"); version = "3.9.0"; } if (success && "3.9.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.0-to-V3.9.9.xsl"); appliedTransformations.add("V3.9.0-to-V3.9.9.xsl"); version = "3.9.9"; } if (success && "3.9.9".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.9-to-V4.0.1.xsl"); appliedTransformations.add("V3.9.9-to-V4.0.1.xsl"); version = "4.0.1"; } if (success && "4.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V4.0.1-to-V4.0.2.xsl"); appliedTransformations.add("V4.0.1-to-V4.0.2.xsl"); version = "4.0.2"; } if (success) { return fileTo; } else { return null; } } catch (Exception e) { throw new PlatoException("Failed to update plan to current version.", e); } }  }
PlanMigrator { public String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations) throws PlatoException { String originalFile = tempPath + "_original.xml"; try { FileUtils.writeToFile(in, new FileOutputStream(originalFile)); fileVersion = "xxx"; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(false); Digester d = new Digester(factory.newSAXParser()); d.setValidating(false); d.push(this); d.addSetProperties("*/projects", "version", "fileVersion"); d.addSetProperties("*/projects/project", "version", "fileVersion"); d.addSetProperties("*/project", "version", "fileVersion"); d.addSetProperties("plans", "version", "fileVersion"); InputStream inV = new FileInputStream(originalFile); d.parse(inV); inV.close(); String version = "1.0"; if (fileVersion != null) { version = fileVersion; } String fileTo = originalFile; String fileFrom = originalFile; boolean success = true; if ("xxx".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.3.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/Vxxx-to-V1.3.xsl"); appliedTransformations.add("Vxxx-to-V1.3.xsl"); version = "1.3"; } if (success && "1.3".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V1.3-to-V1.9.xsl"); appliedTransformations.add("V1.3-to-V1.9.xsl"); version = "1.9"; } if (success && "1.9".equals(version)) { version = "2.0"; } if (success && "2.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.0-to-V2.1.xsl"); appliedTransformations.add("V2.0-to-V2.1.xsl"); version = "2.1"; } if (success && "2.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.2".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.2-to-V3.0.0.xsl"); appliedTransformations.add("V2.1.2-to-V3.0.0.xsl"); version = "3.0.0"; } if (success && "3.0.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.0-to-V3.0.1.xsl"); appliedTransformations.add("V3.0.0-to-V3.0.1.xsl"); version = "3.0.1"; } if (success && "3.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.1-to-V3.9.0.xsl"); appliedTransformations.add("V3.0.1-to-V3.9.0.xsl"); version = "3.9.0"; } if (success && "3.9.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.0-to-V3.9.9.xsl"); appliedTransformations.add("V3.9.0-to-V3.9.9.xsl"); version = "3.9.9"; } if (success && "3.9.9".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.9-to-V4.0.1.xsl"); appliedTransformations.add("V3.9.9-to-V4.0.1.xsl"); version = "4.0.1"; } if (success && "4.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V4.0.1-to-V4.0.2.xsl"); appliedTransformations.add("V4.0.1-to-V4.0.2.xsl"); version = "4.0.2"; } if (success) { return fileTo; } else { return null; } } catch (Exception e) { throw new PlatoException("Failed to update plan to current version.", e); } }  String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations); boolean transformXmlData(final String fromFile, final String toFile, final String xslFile); void setFileVersion(final String fileVersion); }
PlanMigrator { public String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations) throws PlatoException { String originalFile = tempPath + "_original.xml"; try { FileUtils.writeToFile(in, new FileOutputStream(originalFile)); fileVersion = "xxx"; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(false); Digester d = new Digester(factory.newSAXParser()); d.setValidating(false); d.push(this); d.addSetProperties("*/projects", "version", "fileVersion"); d.addSetProperties("*/projects/project", "version", "fileVersion"); d.addSetProperties("*/project", "version", "fileVersion"); d.addSetProperties("plans", "version", "fileVersion"); InputStream inV = new FileInputStream(originalFile); d.parse(inV); inV.close(); String version = "1.0"; if (fileVersion != null) { version = fileVersion; } String fileTo = originalFile; String fileFrom = originalFile; boolean success = true; if ("xxx".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.3.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/Vxxx-to-V1.3.xsl"); appliedTransformations.add("Vxxx-to-V1.3.xsl"); version = "1.3"; } if (success && "1.3".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V1.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V1.3-to-V1.9.xsl"); appliedTransformations.add("V1.3-to-V1.9.xsl"); version = "1.9"; } if (success && "1.9".equals(version)) { version = "2.0"; } if (success && "2.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.0-to-V2.1.xsl"); appliedTransformations.add("V2.0-to-V2.1.xsl"); version = "2.1"; } if (success && "2.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V2.1.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.1-to-V2.1.2.xsl"); appliedTransformations.add("V2.1.1-to-V2.1.2.xsl"); version = "2.1.2"; } if (success && "2.1.2".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V2.1.2-to-V3.0.0.xsl"); appliedTransformations.add("V2.1.2-to-V3.0.0.xsl"); version = "3.0.0"; } if (success && "3.0.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.0-to-V3.0.1.xsl"); appliedTransformations.add("V3.0.0-to-V3.0.1.xsl"); version = "3.0.1"; } if (success && "3.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.0.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.0.1-to-V3.9.0.xsl"); appliedTransformations.add("V3.0.1-to-V3.9.0.xsl"); version = "3.9.0"; } if (success && "3.9.0".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V3.9.9.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.0-to-V3.9.9.xsl"); appliedTransformations.add("V3.9.0-to-V3.9.9.xsl"); version = "3.9.9"; } if (success && "3.9.9".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.1.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V3.9.9-to-V4.0.1.xsl"); appliedTransformations.add("V3.9.9-to-V4.0.1.xsl"); version = "4.0.1"; } if (success && "4.0.1".equals(version)) { fileFrom = fileTo; fileTo = fileFrom + "_V4.0.2.xml"; success = transformXmlData(fileFrom, fileTo, "data/xslt/V4.0.1-to-V4.0.2.xsl"); appliedTransformations.add("V4.0.1-to-V4.0.2.xsl"); version = "4.0.2"; } if (success) { return fileTo; } else { return null; } } catch (Exception e) { throw new PlatoException("Failed to update plan to current version.", e); } }  String getCurrentVersionData(final InputStream in, final String tempPath, final List<String> appliedTransformations); boolean transformXmlData(final String fromFile, final String toFile, final String xslFile); void setFileVersion(final String fileVersion);  }