-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76e2d3b
commit ba45d36
Showing
11 changed files
with
106 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/org/refactoringminer/astDiff/utils/ExportUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.refactoringminer.astDiff.utils; | ||
|
||
import org.refactoringminer.astDiff.actions.ASTDiff; | ||
|
||
/* Created by pourya on 2024-04-02*/ | ||
public class ExportUtils { | ||
private static final String JSON_SUFFIX = ".json"; | ||
private static final String JAVA_SUFFIX = ".java"; | ||
public static String repoToFolder(String repo) { | ||
String folderName = repo.replace("https://github.com/", "").replace(".git",""); | ||
return folderName.replace("/","_") + "/"; | ||
} | ||
public static String getFinalFilePath(ASTDiff astDiff, String dir, String repo, String commit) { | ||
String exportName = getFileNameFromSrcDiff(astDiff.getSrcPath()); | ||
return getFinalFolderPath(dir,repo,commit)+ exportName; | ||
} | ||
public static String getFileNameFromSrcDiff(String astSrcName) | ||
{ | ||
String exportName1 = astSrcName.replace(".java","").replace("/","."); | ||
return exportName1 + JSON_SUFFIX; | ||
} | ||
public static String getSrcASTDiffFromFile(String astSrcName) | ||
{ | ||
String exportName1 = astSrcName.replace(".","/").replace("/json",""); | ||
return exportName1 + JAVA_SUFFIX; | ||
} | ||
|
||
public static String getFinalFolderPath(String dir, String repo, String commit) { | ||
String repoFolder = repoToFolder(repo); | ||
return dir + repoFolder + commit + "/"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters