use of aserg.gtf.model.NewFileInfo in project Truck-Factor by aserg-ufmg.
the class GitTruckFactor method applyRegexSelect.
private static void applyRegexSelect(List<NewFileInfo> files, String exp) {
int count = 0;
for (NewFileInfo newFileInfo : files) {
if (!newFileInfo.getFiltered()) {
if (!newFileInfo.getPath().matches(exp)) {
count++;
newFileInfo.setFiltered(true);
newFileInfo.setFilterInfo("REGEX: " + exp);
}
}
}
LOGGER.info("REGEX FILTER = " + count);
}
use of aserg.gtf.model.NewFileInfo in project Truck-Factor by aserg-ufmg.
the class GitTruckFactorRepList method applyRegexSelect.
private static void applyRegexSelect(List<NewFileInfo> files, String exp) {
int count = 0;
for (NewFileInfo newFileInfo : files) {
if (!newFileInfo.getFiltered()) {
if (!newFileInfo.getPath().matches(exp)) {
count++;
newFileInfo.setFiltered(true);
newFileInfo.setFilterInfo("REGEX: " + exp);
}
}
}
System.out.println("REGEX FILTER = " + count);
}
use of aserg.gtf.model.NewFileInfo in project Truck-Factor by aserg-ufmg.
the class GitTruckFactorRepList method applyRegexFilter.
private static void applyRegexFilter(List<NewFileInfo> files, String exp) {
int count = 0;
for (NewFileInfo newFileInfo : files) {
if (!newFileInfo.getFiltered()) {
if (newFileInfo.getPath().matches(exp)) {
count++;
newFileInfo.setFiltered(true);
newFileInfo.setFilterInfo("REGEX: " + exp);
}
}
}
System.out.println("REGEX FILTER = " + count);
}
use of aserg.gtf.model.NewFileInfo in project Truck-Factor by aserg-ufmg.
the class LinguistExtractor method execute.
public List<NewFileInfo> execute() {
List<NewFileInfo> linguistFiles = new ArrayList<NewFileInfo>();
try {
Map<String, List<String>> languageMap = new HashMap<String, List<String>>();
//System.out.format("%s (%s): Extracting file language information...\n",repositoryName, new Date());
BufferedReader br = new BufferedReader(new FileReader(repositoryPath + fileName));
String sCurrentLine;
String[] values;
while ((sCurrentLine = br.readLine()) != null) {
values = sCurrentLine.split(";");
String language = values[0];
if (language.contains("\'"))
language = language.replace("'", "''");
String path = values[1];
linguistFiles.add(new NewFileInfo(repositoryName, path, language));
}
br.close();
} catch (FileNotFoundException e) {
LOGGER.warn(fileName + " not found. Executing without Linguist filter.");
linguistFiles = null;
} catch (Exception e) {
LOGGER.error("Erro no projeto " + repositoryName, e);
linguistFiles = null;
}
return linguistFiles;
}
use of aserg.gtf.model.NewFileInfo in project Truck-Factor by aserg-ufmg.
the class LinguistExtractor method setNotLinguist.
public List<NewFileInfo> setNotLinguist(List<NewFileInfo> files) throws IOException {
Map<String, NewFileInfo> linguistFilesMap = new HashMap<String, NewFileInfo>();
List<NewFileInfo> linguistFiles = execute();
if (linguistFiles != null) {
for (NewFileInfo linguistFile : linguistFiles) {
linguistFilesMap.put(linguistFile.getPath(), linguistFile);
}
for (NewFileInfo file : files) {
if (linguistFilesMap.containsKey(file.getPath())) {
file.setLanguage(linguistFilesMap.get(file.getPath()).getLanguage());
} else {
file.setFiltered(true);
file.setFilterInfo("NOTLINGUIST");
}
}
}
return files;
}
Aggregations