svn commit: r14016 - trunk/src_new/org/argouml/profile/FileModelLoader.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-28 01:07:19-0800
New Revision: 14016

Modified:
   trunk/src_new/org/argouml/profile/FileModelLoader.java

Log:
Switch FileModelLoader to use URLModelLoader

Modified: trunk/src_new/org/argouml/profile/FileModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/FileModelLoader.java?view=diff&rev=14016&p1=trunk/src_new/org/argouml/profile/FileModelLoader.java&p2=trunk/src_new/org/argouml/profile/FileModelLoader.java&r1=14015&r2=14016
==============================================================================
--- trunk/src_new/org/argouml/profile/FileModelLoader.java	(original)
+++ trunk/src_new/org/argouml/profile/FileModelLoader.java	2007-12-28 01:07:19-0800
@@ -25,9 +25,7 @@
 package org.argouml.profile;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.util.Collection;
 
 import org.apache.log4j.Logger;
@@ -37,23 +35,17 @@
  *
  * @author maurelio1234
  */
-public class FileModelLoader extends StreamModelLoader {
+public class FileModelLoader extends URLModelLoader {
 
     private static final Logger LOG = Logger.getLogger(FileModelLoader.class);
 
     
     public Collection loadModel(String modelFilename) throws ProfileException {
         LOG.info("Loading profile from file'" + modelFilename + "'");
-        InputStream is = null;
-        //
-        //  try to find a file with that name
-        //
         try {
             File modelFile = new File(modelFilename);
-            is = new FileInputStream(modelFile);
-            
-            return super.loadModel(is);
-        } catch (FileNotFoundException ex) {
+            return super.loadModel(modelFile.toURI().toURL());
+        } catch (MalformedURLException e) {
             throw new ProfileException("Model file not found!");
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.