#12 -- Need to detect project structure
parent
2ee965a113
commit
5153270239
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||
*/
|
||||
|
||||
package ru.ulstu.extractor.heuristic.model;
|
||||
|
||||
public class MavenBuildTool extends BuildTool {
|
||||
|
||||
public MavenBuildTool() {
|
||||
super("Gradle");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canAppliedToProject() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||
*/
|
||||
|
||||
package ru.ulstu.extractor.util;
|
||||
|
||||
import java.nio.file.FileSystems;
|
||||
|
||||
public class StringUtils {
|
||||
public final static String EMPTY_STRING = "";
|
||||
private final static String PATH_SEPARATOR = FileSystems.getDefault().getSeparator();
|
||||
|
||||
public static String addPathSeparator(String path) {
|
||||
return path + PATH_SEPARATOR;
|
||||
}
|
||||
|
||||
public static String removePathPrefix(String path, String prefix) {
|
||||
if (prefix.endsWith(PATH_SEPARATOR)) {
|
||||
return path.replace(prefix, EMPTY_STRING);
|
||||
}
|
||||
return path.replace(addPathSeparator(prefix), EMPTY_STRING);
|
||||
}
|
||||
|
||||
public static boolean fileInSubdirectory(String filePath, String projectPath, String subDirectory) {
|
||||
return filePath.startsWith(projectPath + PATH_SEPARATOR + subDirectory);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue