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,15 +68,14 @@ public class UWSMCutoutWork extends JobThread ...@@ -68,15 +68,14 @@ public class UWSMCutoutWork extends JobThread
long startTime_msec = System.currentTimeMillis(); long startTime_msec = System.currentTimeMillis();
boolean showDuration = true; boolean showDuration = true;
logger.logThread(LogLevel.INFO, this, "Is mcutout UploadFile type?", logger.logThread(LogLevel.INFO, this, "", "Job started",null);
"Is mcutout UploadFile type?",null);
Object obj = job.getAdditionalParameterValue("mcutout"); Object obj = job.getAdditionalParameterValue("mcutout");
if(obj instanceof UploadFile) if(obj instanceof UploadFile)
{ {
logger.logThread(LogLevel.INFO, this, "mcutout is UploadFile", logger.logThread(LogLevel.INFO, this, "", "mcutout is UploadFile", null);
"mcutout is UploadFile",null);
UploadFile jsonFile = (UploadFile)obj;//job.getAdditionalParameterValue("mcutout");
UploadFile jsonFile = (UploadFile)obj;
InputStreamReader isr = new InputStreamReader( jsonFile.open() ); InputStreamReader isr = new InputStreamReader( jsonFile.open() );
BufferedReader input = new BufferedReader(isr); BufferedReader input = new BufferedReader(isr);
StringBuffer jsonStringBuffer = new StringBuffer(); StringBuffer jsonStringBuffer = new StringBuffer();
...@@ -98,17 +97,13 @@ public class UWSMCutoutWork extends JobThread ...@@ -98,17 +97,13 @@ public class UWSMCutoutWork extends JobThread
publishOnEndpoint("Report", "application/json", mresult.resJsonPathname); publishOnEndpoint("Report", "application/json", mresult.resJsonPathname);
publishOnEndpoint("mcutout.tar.gz", "application/gzip", mresult.fileName); 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.deleteDirectory(new File(workDir));
//FileUtils.deleteQuietly(new File(workDir));// FIXME Never throws except. leaves the dir there if error
} }
else 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 */ /* FIXME here was uws-check is-job-Interrupted */
...@@ -116,7 +111,8 @@ public class UWSMCutoutWork extends JobThread ...@@ -116,7 +111,8 @@ public class UWSMCutoutWork extends JobThread
catch(IOException ex) catch(IOException ex)
{ {
logger.error("MCutout error", 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.
Please to comment