blob: 04dea7ad0170332131a863fd38aee70339315e50 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2014 Bosch Software Innovations GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* The Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Bosch Software Innovations GmbH - Please refer to git log
*
*******************************************************************************/
package org.eclipse.vorto.api.common.project;
import java.io.File;
import java.io.FilenameFilter;
import org.eclipse.core.resources.IProject;
public class FunctionModelModelFileFinder {
public static File getFunctionModelFile(IProject project) {
File srcModelDirectory = new File(project.getLocation().toFile()
.getAbsolutePath()
+ "/src/models/");
if (!srcModelDirectory.exists()) {
return null;
}
File[] files = srcModelDirectory.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".fbmodel");
}
});
if (files.length == 0) {
return null;
}
return files[0];
}
}