summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src')
-rw-r--r--csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java6
-rw-r--r--csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java5
-rw-r--r--csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java21
3 files changed, 17 insertions, 15 deletions
diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java b/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java
index 4367f0d..745d7cc 100644
--- a/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java
+++ b/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java
@@ -111,7 +111,7 @@ public class CsarUtil {
inputStream.close();
}
} catch (Exception e1) {
- logger.info("close InputStream error!");
+ logger.error("FILE_IO" + ":" + "close InputStream error! " + e1.getMessage(), e1);
}
}
@@ -127,7 +127,7 @@ public class CsarUtil {
outputStream.close();
}
} catch (Exception e1) {
- logger.info("close OutputStream error!");
+ logger.error("FILE_IO" + ":" + "close OutputStream error! " + e1.getMessage(), e1);
}
}
@@ -138,7 +138,7 @@ public class CsarUtil {
return CsarUtil.unzip(filePath, tempfolder);
} catch (IOException e1) {
- logger.error("CSAR extraction error ! " + e1.getMessage());
+ logger.error("CSAR_EXTRACTION" + ":" + "CSAR extraction error ! " + e1.getMessage(), e1);
}
return null;
}
diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java b/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java
index e542b65..14aa6a4 100644
--- a/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java
+++ b/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java
@@ -135,7 +135,7 @@ public class CsarValidator {
return true;
}
} catch (IOException e2) {
- LOG.error("Exception caught while validateCsarMeta ! " + e2.getMessage());
+ LOG.error("CSAR_META_VALIDATION" + ":" + "Exception caught while validateCsarMeta ! " + e2.getMessage(), e2);
}
}
@@ -168,7 +168,7 @@ public class CsarValidator {
}
}
} catch (IOException | NullPointerException e) {
- LOG.error("Could not read file %s ! " + e.getMessage(), cfile);
+ LOG.error("CSAR_TOSCA_VALIDATION" + ":" + "Could not read file %s ! " + e.getMessage(), e, cfile);
}
return false;
}
@@ -218,6 +218,7 @@ public class CsarValidator {
try {
values = (Map<String, ?>) yaml.load(new FileInputStream(new File(tFileWithPath)));
} catch (FileNotFoundException e) {
+ LOG.error("FILE_NOT_FOUND" + ":" + "Exception caught while trying to find the file ! " + e.getMessage(), e);
return false;
}
diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java b/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java
index d3cfd0a..3faaa2a 100644
--- a/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java
+++ b/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java
@@ -103,7 +103,7 @@ public final class FileUtil {
inputStream.close();
}
} catch (Exception e1) {
- logger.info("close InputStream error!");
+ logger.error("FILE_IO" + ":" + "close InputStream error! " + e1.getMessage(), e1);
}
}
@@ -118,7 +118,7 @@ public final class FileUtil {
outputStream.close();
}
} catch (Exception e1) {
- logger.info("close OutputStream error!");
+ logger.error("FILE_IO" + ":" + "close OutputStream error! " + e1.getMessage(), e1);
}
}
@@ -128,7 +128,7 @@ public final class FileUtil {
ifs.close();
}
} catch (Exception e1) {
- logger.info("close OutputStream error!");
+ logger.error("FILE_IO" + ":" + "close OutputStream error! " + e1.getMessage(), e1);
}
}
@@ -143,7 +143,7 @@ public final class FileUtil {
zipFile.close();
}
} catch (IOException e1) {
- logger.info("close ZipFile error!");
+ logger.error("CLOSE_ZIPFILE" + ":" + "close ZipFile error! " + e1.getMessage(), e1);
}
}
@@ -177,15 +177,16 @@ public final class FileUtil {
}
catch (JsonGenerationException e)
{
- logger.info("JsonGenerationException Exception: writeJsonDatatoFile-->"+fileAbsPath);
+ logger.error("JSON_GENERATION" + ":" + "JsonGenerationException Exception: writeJsonDatatoFile-->"+fileAbsPath+" : " + e.getMessage(), e);
+
}
catch (JsonMappingException e)
{
- logger.info("JsonMappingException Exception: writeJsonDatatoFile-->"+fileAbsPath);
+ logger.error("JSON_MAPPING" + ":" + "JsonMappingException Exception: writeJsonDatatoFile-->"+fileAbsPath+" : " + e.getMessage(), e);
}
catch (IOException e)
{
- logger.info("IOException Exception: writeJsonDatatoFile-->"+fileAbsPath);
+ logger.error("FILE_IO" + ":" + "IOException Exception: writeJsonDatatoFile-->"+fileAbsPath+" : " + e.getMessage(), e);
}
return bResult;
}
@@ -209,15 +210,15 @@ public final class FileUtil {
}
catch (JsonParseException e1)
{
- logger.info("JsonParseException Exception: writeJsonDatatoFile-->"+fileAbsPath);
+ logger.error("JSON_PARSING" + ":" + "JsonParseException Exception: writeJsonDatatoFile-->"+fileAbsPath+" : " + e1.getMessage(), e1);
}
catch (JsonMappingException e1)
{
- logger.info("JsonMappingException Exception: writeJsonDatatoFile-->"+fileAbsPath);
+ logger.error("JSON_MAPPING" + ":" + "JsonMappingException Exception: writeJsonDatatoFile-->"+fileAbsPath+" : " + e1.getMessage(), e1);
}
catch (IOException e1)
{
- logger.info("IOException Exception: writeJsonDatatoFile-->"+fileAbsPath);
+ logger.error("FILE_IO" + ":" + "IOException Exception: writeJsonDatatoFile-->"+fileAbsPath+" : " + e1.getMessage(), e1);
}
return obj;
}