for (File file : files) { XMLMessage message = new XMLMessage(); xmlMessageList.add(message); if (file.isDirectory()) { String fileName = file.getName(); System.out.print(fileName); message.setFileName(fileName); //folderFile.setFileName(fileName); showFiles(file.listFiles()); // Calls same method again. } else { ... etc, using message instead of xmlMessageList.get(i) } }
List<XMLMessage> xmlMessageList = new ArrayList<>(); xmlMessageList.add(new XMLMessage()); XMLMessageList.get(0).setFileName("my_file.txt");
@Override public void handleMessage(XMLMessage message) throws Fault { Exchange exchange = message.getExchange(); // TODO break out into a strategy (not JAXRS-specific) OperationResourceInfo operationResourceInfo = exchange.get(OperationResourceInfo.class); if (operationResourceInfo == null) { message.getInterceptorChain().doIntercept(message); return; } // TODO annotate with a better name? String methodName = operationResourceInfo.getMethodToInvoke().getName(); // TODO annotate with a better name? Object key = operationResourceInfo.getClassResourceInfo().getResourceProvider() .getInstance(); if (!(key instanceof Timeable)) { message.getInterceptorChain().doIntercept(message); return; } EventMetricCollector collector = timer.getCollector(); collector.startTiming((Timeable) key, methodName); try { message.getInterceptorChain().doIntercept(message); } finally { collector.stopTiming(); } } }
public Message createMessage(Message m) { if (!m.containsKey(Message.CONTENT_TYPE)) { String ct = null; // Should this be done in ServiceInvokerInterceptor to support a case where the // response content type is detected early on the inbound chain for all the bindings ? Exchange exchange = m.getExchange(); if (exchange != null) { ct = (String)exchange.get(Message.CONTENT_TYPE); } if (ct == null) { ct = "text/xml"; } m.put(Message.CONTENT_TYPE, ct); } return new XMLMessage(m); } }
public Message createMessage(Message m) { if (!m.containsKey(Message.CONTENT_TYPE)) { String ct = null; // Should this be done in ServiceInvokerInterceptor to support a case where the // response content type is detected early on the inbound chain for all the bindings ? Exchange exchange = m.getExchange(); if (exchange != null) { ct = (String)exchange.get(Message.CONTENT_TYPE); } if (ct == null) { ct = "text/xml"; } m.put(Message.CONTENT_TYPE, ct); } return new XMLMessage(m); } }