org.eclipse.dirigible.bpm.flowable.synchronizer.BpmClasspathContentHandler Maven / Gradle / Ivy
/**
* Copyright (c) 2010-2018 SAP and others.
* 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
*
* Contributors:
* SAP - initial API and implementation
*/
package org.eclipse.dirigible.bpm.flowable.synchronizer;
import java.io.IOException;
import org.eclipse.dirigible.bpm.flowable.BpmProviderFlowable;
import org.eclipse.dirigible.commons.api.content.AbstractClasspathContentHandler;
import org.eclipse.dirigible.commons.api.module.StaticInjector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class BpmnClasspathContentHandler.
*/
public class BpmClasspathContentHandler extends AbstractClasspathContentHandler {
private static final Logger logger = LoggerFactory.getLogger(BpmClasspathContentHandler.class);
private BpmSynchronizer bpmnSynchronizer = StaticInjector.getInjector().getInstance(BpmSynchronizer.class);
/*
* (non-Javadoc)
* @see org.eclipse.dirigible.commons.api.content.AbstractClasspathContentHandler#isValid(java.lang.String)
*/
@Override
protected boolean isValid(String path) {
boolean isValid = false;
try {
if (path.endsWith(BpmProviderFlowable.FILE_EXTENSION_BPMN)) {
isValid = true;
bpmnSynchronizer.registerPredeliveredBpmnFiles(path);
}
} catch (IOException e) {
logger.error("Predelivered BPMN is not valid", e);
}
return isValid;
}
/*
* (non-Javadoc)
* @see org.eclipse.dirigible.commons.api.content.AbstractClasspathContentHandler#getLogger()
*/
@Override
protected Logger getLogger() {
return logger;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy