Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 32137)
+++ trunk/ippToPsps/jython/batch.py	(revision 32138)
@@ -64,5 +64,5 @@
         self.survey = self.doc.find("options/survey").text
         self.pspsSurvey = self.doc.find("options/pspsSurvey").text
-        dvoGpc1Label = self.doc.find("dvo/gpc1Label").text
+        self.dvoGpc1Label = self.doc.find("dvo/gpc1Label").text
         self.dvoLocation = self.doc.find("dvo/location").text
         self.useFullTables = int(self.doc.find("dvo/useFullTables").text)
@@ -78,5 +78,4 @@
         else:
             self.surveyID = -1;
-
        
         # get some options from the config
@@ -92,19 +91,19 @@
                 self.id,
                 self.survey,
-                dvoGpc1Label, 
+                self.dvoGpc1Label, 
                 self.datastore.product)
 
         # get local storage location from config
         self.batchName = Batch.getNameFromID(self.batchID)
-        basePath = self.doc.find("localOutPath").text
+        self.basePath = self.doc.find("localOutPath").text
         self.subDir = Batch.getSubDir(
-                basePath,
+                self.basePath,
                 self.batchType, 
-                dvoGpc1Label)
+                self.dvoGpc1Label)
 
         self.localOutPath = Batch.getOutputPath(
-                basePath,
+                self.basePath,
                 self.batchType, 
-                dvoGpc1Label,
+                self.dvoGpc1Label,
                 self.batchID)
 
@@ -155,4 +154,50 @@
     def getOutputPath(basePath, batchType, dvoLabel, id):
        return Batch.getSubDir(basePath, batchType, dvoLabel) + "/" + Batch.getNameFromID(id)
+
+    '''
+    Static method to get name of tar file
+    '''
+    @staticmethod
+    def getTarFile(id):
+        return Batch.getNameFromID(id) + ".tar"
+
+    '''
+    Static method to get path of tar file
+    '''
+    @staticmethod
+    def getTarPath(basePath, batchType, dvoLabel, id):
+        return Batch.getSubDir(basePath, batchType, dvoLabel) + "/" + Batch.getTarFile(id)
+
+    '''
+    Static method to get name of tarball file
+    '''
+    @staticmethod
+    def getTarballFile(id):
+        return Batch.getTarFile(id) + ".gz"
+
+    '''
+    Static method to get path of tarball file
+    '''
+    @staticmethod
+    def getTarballPath(basePath, batchType, dvoLabel, id):
+        return Batch.getSubDir(basePath, batchType, dvoLabel) + "/" + Batch.getTarballFile(id)
+
+    '''  
+    Static method to delete this batch from local disk
+    '''
+    @staticmethod
+    def deleteFromDisk(basePath, batchType, dvoLabel, id):
+       
+        tarballPath = Batch.getTarballPath(basePath, batchType, dvoLabel, id)
+        dirPath = Batch.getOutputPath(basePath, batchType, dvoLabel, id)
+
+        if not os.path.exists(tarballPath): return 1
+
+        try:
+            os.remove(tarballPath)
+        except:
+            return 0
+   
+        return 1
 
     '''
@@ -243,9 +288,8 @@
       
         # set up filenams and paths
-        tarFile = self.batchName + ".tar"
-        tarPath = self.subDir + "/" + tarFile
-
-        tarballFile = tarFile + ".gz"
-        tarballPath = self.subDir + "/" + tarballFile
+        tarFile = Batch.getTarFile(self.batchID)
+        tarPath = Batch.getTarPath(self.basePath, self.batchType, self.dvoGpc1Label, self.batchID)
+        tarballFile = Batch.getTarballFile(self.batchID)
+        tarballPath = Batch.getTarballPath(self.basePath, self.batchType, self.dvoGpc1Label, self.batchID)
 
         # tar directory
@@ -293,5 +337,5 @@
             rs.close()
 
-        self.ippToPspsDb.updateMinMaxObjID(self.batchID, self.minObjID, self.maxObjID)
+        self.ippToPspsDb.updateDetectionStats(self.batchID, self.minObjID, self.maxObjID, self.totalDetections)
         self.logger.infoPair("Total detections", "%ld" % self.totalDetections)
         self.logger.infoPair("Min objID", "%ld" % self.minObjID)
