You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/03/20 14:51:54 UTC

[GitHub] [knox] pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302

pzampino commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r395688935
 
 

 ##########
 File path: gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
 ##########
 @@ -153,17 +146,18 @@ private Topology loadTopology(File file) throws IOException, SAXException, Inter
     return topology;
   }
 
+  @Override
+  public Topology parse(final InputStream content) throws IOException, SAXException {
+    return TopologyUtils.parse(content);
+  }
+
   private Topology loadTopologyAttempt(File file) throws IOException, SAXException {
-    Topology topology;
-    Digester digester = digesterLoader.newDigester();
-    TopologyBuilder topologyBuilder = digester.parse(FileUtils.openInputStream(file));
-    if (null == topologyBuilder) {
-      return null;
-    }
-    topology = topologyBuilder.build();
-    topology.setUri(file.toURI());
-    topology.setName(FilenameUtils.removeExtension(file.getName()));
-    topology.setTimestamp(file.lastModified());
+    Topology topology = parse(FileUtils.openInputStream(file));
 
 Review comment:
   That makes sense.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services