Author: scamp
Date: Fri Apr  8 14:38:58 2005
New Revision: 160619

URL: http://svn.apache.org/viewcvs?view=rev&rev=160619
Log:
modified to only produce a .bak file each time to avoid unnecessay backups of 
the iml file to be maintained....

Modified:
    
incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java

Modified: 
incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java?view=diff&r1=160618&r2=160619
==============================================================================
--- 
incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java
 (original)
+++ 
incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java
 Fri Apr  8 14:38:58 2005
@@ -106,11 +106,6 @@
     private static final String SOURCES_ELEM = "SOURCES";
 
     /**
-     * Date Format String for writing backup of original iml file
-     */
-    private static final String BACKUP_DATE_FORMAT = "yyMMddHHmmss";
-
-    /**
      * IML extension
      */
     private static final String IML_FILE_EXTENSION = ".iml";
@@ -279,9 +274,9 @@
         if (m_isModified)
         {
             //backup the original file...
-            SimpleDateFormat dateFormat = new 
SimpleDateFormat(BACKUP_DATE_FORMAT);
+
             File tempFile =
-                    new File(m_iml.substring(0, m_iml.length() - 3) + 
dateFormat.format(new Date())
+                    new File(m_iml.substring(0, m_iml.length() - 3) + "bak"
                              + IML_FILE_EXTENSION);
             writeFile(tempFile, m_originalDom);
 
@@ -302,7 +297,7 @@
             System.out.println("Adding " + depMap.values().size()
                                + " new entries to the IntelliJ Idea .iml 
file.");
         }
-//write the rest of the dep map nodes into the doc
+        //write the rest of the dep map nodes into the doc
         Iterator iterator = depMap.values().iterator();
         Node newModuleRootManager = null;
         NodeList componentNodes = 
m_modifiableDom.getElementsByTagName(COMPONENT_ELEM);
@@ -452,6 +447,12 @@
         {
             throw new IllegalArgumentException("The provided .iml path: " + 
m_iml
                                                + " does not exist, please 
check your settings.");
+        }
+
+        if (imlFile.isDirectory())
+        {
+            throw new IllegalArgumentException("The provided .iml path: " + 
m_iml
+                                               + " is a directory!, please 
check your settings and ensure you are pointing to the actual .iml file.");
         }
 
         //hold a ref to the original file



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to