fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [6803] Added logging and deletion of models


From: Petur Bjorn Thorsteinsson
Subject: [Fmsystem-commits] [6803] Added logging and deletion of models
Date: Tue, 18 Jan 2011 15:25:35 +0000

Revision: 6803
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6803
Author:   peturbjorn
Date:     2011-01-18 15:25:35 +0000 (Tue, 18 Jan 2011)
Log Message:
-----------
Added logging and deletion of models

Modified Paths:
--------------
    thirdparty/BIM_converter/trunk/src/no/ifc/rest/UploadIfc.java

Modified: thirdparty/BIM_converter/trunk/src/no/ifc/rest/UploadIfc.java
===================================================================
--- thirdparty/BIM_converter/trunk/src/no/ifc/rest/UploadIfc.java       
2011-01-18 15:23:10 UTC (rev 6802)
+++ thirdparty/BIM_converter/trunk/src/no/ifc/rest/UploadIfc.java       
2011-01-18 15:25:35 UTC (rev 6803)
@@ -21,6 +21,9 @@
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import no.bimfm.ifc.RepositoriesImpl;
 import no.bimfm.ifc.RepositoryExceptionUc;
 import no.bimfm.ifc.v2x3.IfcModelImpl;
@@ -31,6 +34,7 @@
 
 @Path("/uploadIfc")
 public class UploadIfc {
+       private Logger logger = 
LoggerFactory.getLogger("no.ifc.rest.UploadIfc");
        @GET
        @Produces(MediaType.TEXT_HTML)
        public String sayHtmlHello() {
@@ -42,7 +46,7 @@
        @Consumes("multipart/form-data")
        @Produces(MediaType.TEXT_HTML)
        public String uploadFile(@FormDataParam("file") File file, 
@FormDataParam("file") FormDataContentDisposition fcdsFile,  
@FormDataParam("file") InputStream attachmentFile,@FormDataParam("repoName") 
String repoName) {
-               
+               logger.debug("Upload initiated");
                //String fileLocation = "/files/" + fcdsFile.getFileName();
                String fileLocation = fcdsFile.getFileName();
                /*try {
@@ -71,12 +75,12 @@
                        //file.close();
                        in.close();
                        out.close();
-                       System.out.println("Upload success!");
+                       logger.info("Upload success!");
                } catch (FileNotFoundException e) {
-                       System.out.println("Upload failure (fnf)!");
+                       logger.error("Upload failure (fnf)!");
                        e.printStackTrace();
                } catch (IOException e) {
-                       System.out.println("Upload failure (io)!");
+                       logger.error("Upload failure (io)!");
                        e.printStackTrace();
                }
                //String ifcFilename = 
(Thread.currentThread().getContextClassLoader().get 
Resource(testIfcFileName)).toString();
@@ -87,9 +91,10 @@
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                }
-               System.out.println(path);
+               logger.info("Path to save the file in is {}", path);
                
                RepositoriesImpl repo = new RepositoriesImpl();
+               repo.deleteAllRepositories();
                System.out.println(path + "\\" + testIfcFileName);
                try {
                        if(repo.addRepository(repoName, path + File.separator + 
testIfcFileName)){




reply via email to

[Prev in Thread] Current Thread [Next in Thread]