Skip to content
Snippets Groups Projects
Commit db866e95 authored by Robert Butora's avatar Robert Butora
Browse files

mcutout: improve logging when checking UploadFile-type in POST-body

parent b9fd2417
No related branches found
No related tags found
No related merge requests found
......@@ -68,16 +68,15 @@ public class UWSMCutoutWork extends JobThread
long startTime_msec = System.currentTimeMillis();
boolean showDuration = true;
logger.logThread(LogLevel.INFO, this, "Is mcutout UploadFile type?",
"Is mcutout UploadFile type?",null);
logger.logThread(LogLevel.INFO, this, "", "Job started",null);
Object obj = job.getAdditionalParameterValue("mcutout");
if(obj instanceof UploadFile)
{
logger.logThread(LogLevel.INFO, this, "mcutout is UploadFile",
"mcutout is UploadFile",null);
UploadFile jsonFile = (UploadFile)obj;//job.getAdditionalParameterValue("mcutout");
logger.logThread(LogLevel.INFO, this, "", "mcutout is UploadFile", null);
InputStreamReader isr = new InputStreamReader(jsonFile.open());
UploadFile jsonFile = (UploadFile)obj;
InputStreamReader isr = new InputStreamReader( jsonFile.open() );
BufferedReader input = new BufferedReader(isr);
StringBuffer jsonStringBuffer = new StringBuffer();
String line;
......@@ -98,17 +97,13 @@ public class UWSMCutoutWork extends JobThread
publishOnEndpoint("Report", "application/json", mresult.resJsonPathname);
publishOnEndpoint("mcutout.tar.gz", "application/gzip", mresult.fileName);
// delete cut-files (were published/copied to uws-file store)
//mresult.deleteResJson();
//mresult.deleteCutFiles();
FileUtils.deleteDirectory(new File(workDir));
//FileUtils.deleteQuietly(new File(workDir));// FIXME Never throws except. leaves the dir there if error
}
else
{
// mcutout-json not in body
logger.logThread(LogLevel.INFO, this, "",
"mcutout is NOT UploadFile type: wrong argument ? Nothing to do, exiting..."
, null);
}
/* FIXME here was uws-check is-job-Interrupted */
......@@ -116,7 +111,8 @@ public class UWSMCutoutWork extends JobThread
catch(IOException ex)
{
logger.error("MCutout error", ex);
throw new UWSException("Internal error: jsonFile.open() throws IOException:" + ex.getMessage());
throw new UWSException("UploadFile::jsonFile.open() throws IOException:"
+ ex.getMessage());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment