@@ -0,0 +1,2947 @@
+/*%0A * ProActive Parallel Suite(TM):%0A * The Open Source library for parallel and distributed%0A * Workflows & Scheduling, Orchestration, Cloud Automation%0A * and Big Data Analysis on Enterprise Grids & Clouds.%0A *%0A * Copyright (c) 2007 - 2017 ActiveEon%0A * Contact: contact@activeeon.com%0A *%0A * This library is free software: you can redistribute it and/or%0A * modify it under the terms of the GNU Affero General Public License%0A * as published by the Free Software Foundation: version 3 of%0A * the License.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A *%0A * If needed, contact us to obtain a release under GPL Version 2 or 3%0A * or a different license than the AGPL.%0A */%0Apackage org.ow2.proactive_grid_cloud_portal.scheduler.client;%0A%0Aimport java.io.InputStream;%0Aimport java.rmi.ServerException;%0A%0Aimport javax.xml.parsers.DocumentBuilder;%0Aimport javax.xml.parsers.DocumentBuilderFactory;%0Aimport javax.xml.xpath.XPath;%0Aimport javax.xml.xpath.XPathConstants;%0Aimport javax.xml.xpath.XPathExpression;%0Aimport javax.xml.xpath.XPathExpressionException;%0Aimport javax.xml.xpath.XPathFactory;%0A%0Aimport org.w3c.dom.Document;%0Aimport org.xml.sax.InputSource;%0A%0A%0Apublic class ExecutionCalendarFromXmlRetriever %7B%0A%0A    private static final String EXECUTION_CALENDAR_TAG = %22EXECUTION_CALENDARS%22;%0A%0A    private static DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();%0A%0A    public String getExecutionCalendarTagValueFrom(InputStream xmlContent) throws Exception %7B%0A        try %7B%0A            DocumentBuilder documentBuilder = dbf.newDocumentBuilder();%0A            Document xmlDocument = documentBuilder.parse(new InputSource(xmlContent));%0A            return (String) getExecutionCalendarTagTextExpression(xmlDocument).evaluate(xmlDocument,%0A                                                                                        XPathConstants.STRING);%0A        %7D catch (org.xml.sax.SAXParseException parseException) %7B%0A            throw new Exception(%22A parsing error occurred while extracting the execution calendar generic information.%22,%0A                                parseException);%0A        %7D catch (Exception ex) %7B%0A            throw new ServerException(ExecutionCalendarFromXmlRetriever.class.getName() + %22 : %22 + ex.getMessage(), ex);%0A        %7D%0A    %7D%0A%0A    private XPathExpression getExecutionCalendarTagTextExpression(Document xmlDoc) throws XPathExpressionException %7B%0A        XPathFactory xPathFactory = XPathFactory.newInstance();%0A        XPath xPath = xPathFactory.newXPath();%0A        return xPath.compile(%22/job/genericInformation/info%5B@name='%22 + EXECUTION_CALENDAR_TAG + %22'%5D/@value%22);%0A    %7D%0A%0A%7D%0A

Update XML parsing