Author: tfmorris
Date: 2008-05-08 09:18:39-0700
New Revision: 14666

Modified:
   trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java
   trunk/src/argouml-app/src/org/argouml/profile/Profile.java
   trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java
   trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java
   trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java
   trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java
   trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java
   trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java
   trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java
   trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java

Log:
Remove more deprecated methods.  Other pre-release cleanup

Modified: trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java  
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/FileModelLoader.java  
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -40,24 +40,6 @@
 
     private static final Logger LOG = Logger.getLogger(FileModelLoader.class);
 
-    @Deprecated
-    public Collection loadModel(String modelFilename) throws ProfileException {
-        LOG.info("Loading profile from file'" + modelFilename + "'");
-        try {
-            File modelFile = new File(modelFilename);
-            URL url = modelFile.toURI().toURL();
-            URL url2 = null;
-            try {
-                url2 = new URL(modelFile.getName());
-            } catch (MalformedURLException e) {
-                LOG.error("Exception", e);
-            }
-            return super.loadModel(url, url2);
-        } catch (MalformedURLException e) {
-            throw new ProfileException("Model file not found!");
-        }
-    }
-
     public Collection loadModel(ProfileReference reference) 
         throws ProfileException {
         LOG.info("Loading profile from file'" + reference.getPath() + "'");

Modified: trunk/src/argouml-app/src/org/argouml/profile/Profile.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/Profile.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/Profile.java&p2=trunk/src/argouml-app/src/org/argouml/profile/Profile.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/Profile.java  (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/Profile.java  2008-05-08 
09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -26,11 +26,8 @@
 
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
-import org.argouml.model.Model;
-
 
 /**
  * Abstract class representing a Profile.  It contains default types and 

Modified: trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java&p2=trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java    
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/ProfileFacade.java    
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice

Modified: trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java       
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/ProfileModelLoader.java       
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -33,28 +33,15 @@
  */
 public interface ProfileModelLoader {
     
-    /**
-     * Load a model from the specified path.
-     * 
-     * @param path the path where the profile can be found. <em>Note:</em>The
-     *                expected string format is implementation specific!
-     * @return the set of defined packages
-     * @throws ProfileException if the profile could not be loaded for some
-     *                 reason
-     * @deprecated for 0.25.5 by euluis. 
-     * Use [EMAIL PROTECTED] #loadModel(ProfileReference)} instead.
-     */
-    @Deprecated
-    Collection loadModel(String path) throws ProfileException;  
     
     /**
      * Load a model from the specified path.
      * 
-     * @param reference the reference to the profile file, which contains the 
-     * path where the profile file can be found.
+     * @param reference the reference to the profile file, which contains the
+     *                path where the profile file can be found.
      * @return the set of defined packages.
      * @throws ProfileException if the profile could not be loaded for some
-     * reason.
+     *                 reason.
      */
     Collection loadModel(ProfileReference reference) throws ProfileException;  
 }

Modified: trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java        
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/ReaderModelLoader.java        
2008-05-08 09:18:39-0700
@@ -56,27 +56,6 @@
         this.reader = theReader;
     }
 
-    /* 
-     * @see ProfileModelLoader#loadModel(String)
-     */
-    @SuppressWarnings("deprecation")
-    @Deprecated
-    public Collection loadModel(final String path) throws ProfileException {
-        if (reader != null) {
-            try {
-                XmiReader xmiReader = Model.getXmiReader();
-                InputSource inputSource = new InputSource(reader);
-                inputSource.setSystemId(path);
-                Collection elements = xmiReader.parse(inputSource, true);
-                return elements;
-            } catch (UmlException e) {
-                LOG.error("Exception while loading profile ", e);
-                throw new ProfileException("Invalid XMI data!");
-            }
-        }
-        LOG.error("Profile not found");
-        throw new ProfileException("Profile not found!");
-    }
 
     /* 
      * @see ProfileModelLoader#loadModel(ProfileReference)

Modified: trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java      
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/ResourceModelLoader.java      
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,8 +24,6 @@
 
 package org.argouml.profile;
 
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.Collection;
 
 import org.apache.log4j.Logger;
@@ -62,20 +60,6 @@
         clazz = c;
     }
 
-    /*
-     * @see org.argouml.profile.ProfileModelLoader#loadModel(java.lang.String)
-     */
-    @Deprecated
-    public Collection loadModel(String path) throws ProfileException {
-        LOG.info("Loading profile from resource'" + path + "'");
-        URL url = null;
-        try {
-            url = new URL(path);
-        } catch (MalformedURLException e) {
-            LOG.error("Exception", e);
-        }
-        return super.loadModel(clazz.getResource(path), url);
-    }
     
     public Collection loadModel(ProfileReference reference) 
         throws ProfileException {

Modified: trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java        
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/StreamModelLoader.java        
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -43,34 +43,12 @@
 
     private static final Logger LOG = 
Logger.getLogger(StreamModelLoader.class);
 
-    /**
-     * @param inputStream the stream from where the model should be loaded
-     * @return the model
-     * @throws ProfileException if the XMIReader couldn't read the input stream
-     */
-    @Deprecated
-    public Collection loadModel(InputStream inputStream) 
-        throws ProfileException {
-        
-        if (inputStream != null) {
-            try {
-                XmiReader xmiReader = Model.getXmiReader();
-                InputSource inputSource = new InputSource(inputStream);
-                Collection elements = xmiReader.parse(inputSource, true);
-                return elements;
-            } catch (UmlException e) {
-                LOG.error("Exception while loading profile ", e);
-                throw new ProfileException("Invalid XMI data!");
-            }
-        }
-        LOG.error("Profile not found");
-        throw new ProfileException("Profile not found!");
-    }
+
 
     /**
      * @param inputStream the stream from where the model should be loaded
-     * @param publicReference the URL to be used as the public reference of 
-     * the profile that will be loaded.
+     * @param publicReference the URL to be used as the public reference of the
+     *                profile that will be loaded.
      * @return the model
      * @throws ProfileException if the XMIReader couldn't read the input stream
      */

Modified: trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java   
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java   
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice

Modified: trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java&p2=trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java       
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java       
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice

Modified: trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java?view=diff&rev=14666&p1=trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java&r1=14665&r2=14666
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java   
(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/ZipModelLoader.java   
2008-05-08 09:18:39-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -44,45 +44,7 @@
 
     private static final Logger LOG = Logger.getLogger(ZipModelLoader.class);
 
-    @Deprecated
-    public Collection loadModel(String modelFilename) throws ProfileException {
-        LOG.info("Loading profile from ZIP '" + modelFilename + "'");
-
-        InputStream is = null;
-        File modelFile = new File(modelFilename);
-        // TODO: This is in the wrong place.  It's not profile specific.
-        // It needs to be moved to main XMI reading code. - tfm 20060326
-        if (modelFilename.endsWith("zip")) {
-            String filename = modelFile.getName();
-            String extension = filename.substring(filename.indexOf('.'),
-                    filename.lastIndexOf('.'));
-            String path = modelFile.getParent();
-            // Add the path of the model to the search path, so we can
-            // read dependent models
-            if (path != null) {
-                System.setProperty("org.argouml.model.modules_search_path",
-                        path);
-            }
-            try {
-                is = openZipStreamAt(modelFile.toURI().toURL(), extension);
-            } catch (MalformedURLException e) {
-                LOG.error("Exception while loading profile '" + modelFilename
-                        + "'", e);
-                throw new ProfileException(e);
-            } catch (IOException e) {
-                LOG.error("Exception while loading profile '" + modelFilename
-                        + "'", e);
-                throw new ProfileException(e);
-            }
-
-            if (is != null) {
-                return super.loadModel(is);
-            }
-        }
-        
-        throw new ProfileException("Profile could not be loaded!");
-    }
-    
+   
     public Collection loadModel(ProfileReference reference) 
         throws ProfileException {
         LOG.info("Loading profile from ZIP '" + reference.getPath() + "'");
@@ -105,12 +67,12 @@
             try {
                 is = openZipStreamAt(modelFile.toURI().toURL(), extension);
             } catch (MalformedURLException e) {
-                LOG.error("Exception while loading profile '" + 
reference.getPath()
-                        + "'", e);
+                LOG.error("Exception while loading profile '"
+                        + reference.getPath() + "'", e);
                 throw new ProfileException(e);
             } catch (IOException e) {
-                LOG.error("Exception while loading profile '" + 
reference.getPath()
-                        + "'", e);
+                LOG.error("Exception while loading profile '"
+                        + reference.getPath() + "'", e);
                 throw new ProfileException(e);
             }
 

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

Reply via email to