/* * Copyright (c) 2015 Red Hat, Inc. and/or its affiliates. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.jberet.testapps.loadBatchXml; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import org.jberet.tools.AbstractJobXmlResolver; /** * @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a> */ public class AbsolutePathJobXmlResolver extends AbstractJobXmlResolver { @Override public InputStream resolveJobXml(final String jobXml, final ClassLoader classLoader) throws IOException { final File file = new File(jobXml); if (file.exists()) { return new BufferedInputStream(new FileInputStream(file)); } return null; } }