Project

General

Profile

« Previous | Next » 

Revision 5642

Added by berkley about 14 years ago

remove temp files after multipart read

View differences:

src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
1294 1294
    private void putObject(String guid, String action) {
1295 1295
        logMetacat.debug("Entering putObject: " + guid + "/" + action);
1296 1296
        OutputStream out = null;
1297
        Hashtable<String, File> parts = null;
1297 1298
        try {
1298 1299
            out = response.getOutputStream();
1299 1300
            response.setStatus(200);
......
1307 1308
            logMetacat.debug("Disassembling MIME multipart form");
1308 1309
            InputStream object = null;
1309 1310
            InputStream sysmeta = null;
1310
            Hashtable<String, File> parts;
1311 1311
            
1312 1312
            try
1313 1313
            {
......
1389 1389
            }
1390 1390
            
1391 1391
            //clean up the MMP files
1392
            //parts.get("sysmeta").delete();
1393
            //parts.get("object").delete();
1392
            parts.get("sysmeta").delete();
1393
            parts.get("object").delete();
1394 1394
        } catch (NotAuthorized e) {
1395 1395
            response.setStatus(500);
1396 1396
            serializeException(e, out);
......
1431 1431
            InvalidSystemMetadata ism = new InvalidSystemMetadata("1080", e.getMessage());
1432 1432
            serializeException(ism, out);
1433 1433
        }
1434
        finally
1435
        {
1436
            if(parts != null)
1437
            {
1438
                parts.get("sysmeta").delete();
1439
                parts.get("object").delete();
1440
            }
1441
        }
1434 1442
    }
1435 1443

  
1436 1444
    /**

Also available in: Unified diff