]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java
Remove deprecated APIs
[gpl/argeo-slc.git] / runtime / org.argeo.slc.detached / src / main / java / org / argeo / slc / detached / drivers / FileDriver.java
index 07d062e182e078671d6b63eeb0f9b83812bd9e30..4e1cef4c387158dcace2d4e4657e97311830932a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Mathieu Baudier
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.argeo.slc.detached.drivers;
 
 import java.io.File;
@@ -72,12 +71,12 @@ public class FileDriver implements DetachedClient, DetachedDriver,
        // Counters to avoid naming files with same prefix
        private long lastSentTime = 0;
        private int counter = 0;
-       
-       private DetachedXmlConverter xmlConverter = null;       
-       
+
+       private DetachedXmlConverter xmlConverter = null;
+
        private long receiveAnswerTimeout = 10000l;
-       
-       private boolean active = true; 
+
+       private boolean active = true;
 
        public synchronized DetachedRequest receiveRequest() throws Exception {
                DetachedRequest request = (DetachedRequest) receiveFile(requestsDir,
@@ -85,8 +84,7 @@ public class FileDriver implements DetachedClient, DetachedDriver,
                if (request != null)
                        if (log.isTraceEnabled())
                                log.trace("Received detached request #" + request.getUuid()
-                                               + " for ref '" + request.getRef() + "', path="
-                                               + request.getPath());
+                                               + " for ref '" + request.getRef());
                return request;
        }
 
@@ -110,8 +108,7 @@ public class FileDriver implements DetachedClient, DetachedDriver,
                sendFile(requestsDir, request);
                if (log.isTraceEnabled())
                        log.trace("Sent     detached request #" + request.getUuid()
-                                       + " for ref '" + request.getRef() + "', path="
-                                       + request.getPath());
+                                       + " for ref '" + request.getRef());
        }
 
        protected synchronized void sendFile(File dir, DetachedCommunication detCom)
@@ -133,8 +130,8 @@ public class FileDriver implements DetachedClient, DetachedDriver,
 
                // Create file path
                StringBuffer filePath = new StringBuffer(dir.getPath());
-               filePath.append(File.separatorChar).append(sdf.format(nowDate)).append(
-                               '-');
+               filePath.append(File.separatorChar).append(sdf.format(nowDate))
+                               .append('-');
                filePath.append(mf.format(new Object[] { new Long(counter) })).append(
                                '-');
                filePath.append(detCom.getUuid()).append(ext);
@@ -226,13 +223,13 @@ public class FileDriver implements DetachedClient, DetachedDriver,
                FileUtils.moveFileToDirectory(file, processedDir, false);
                return detCom;
        }
-       
+
        public synchronized void stop() {
                log.debug("Stopping Detached Driver");
                active = false;
                notifyAll();
-       }       
-       
+       }
+
        private synchronized boolean isActive() {
                return active;
        }