diff --git a/src/java/main/br/ufpe/cin/groundhog/parser/JavaParser.java b/src/java/main/br/ufpe/cin/groundhog/parser/JavaParser.java index 904bc4b..454a530 100644 --- a/src/java/main/br/ufpe/cin/groundhog/parser/JavaParser.java +++ b/src/java/main/br/ufpe/cin/groundhog/parser/JavaParser.java @@ -109,7 +109,7 @@ public JSONObject parseToJSON() throws IOException, JSONException { } /** - * Pretty print metrics. + * Pretty print metrics * @param counters parse method result */ public static void printResult(HashMap> counters) { diff --git a/src/java/main/br/ufpe/cin/groundhog/search/SearchException.java b/src/java/main/br/ufpe/cin/groundhog/search/SearchException.java index 059f628..6f3b273 100644 --- a/src/java/main/br/ufpe/cin/groundhog/search/SearchException.java +++ b/src/java/main/br/ufpe/cin/groundhog/search/SearchException.java @@ -8,5 +8,4 @@ public class SearchException extends GroundhogException { public SearchException(Exception e) { super(e); } - } \ No newline at end of file diff --git a/src/java/main/br/ufpe/cin/groundhog/util/FileUtil.java b/src/java/main/br/ufpe/cin/groundhog/util/FileUtil.java index 7c38c46..f0c698b 100644 --- a/src/java/main/br/ufpe/cin/groundhog/util/FileUtil.java +++ b/src/java/main/br/ufpe/cin/groundhog/util/FileUtil.java @@ -10,6 +10,7 @@ public class FileUtil { private static FileUtil instance; + private ArrayList createdTempDirs; public static FileUtil getInstance() { if (instance == null) { @@ -18,32 +19,53 @@ public static FileUtil getInstance() { return instance; } - private ArrayList createdTempDirs; - private FileUtil() { - createdTempDirs = new ArrayList(); + this.createdTempDirs = new ArrayList(); } + /** + * + * @return the created temporary directory + */ public synchronized File createTempDir() { File tempDir = Files.createTempDir(); - createdTempDirs.add(tempDir); + this.createdTempDirs.add(tempDir); return tempDir; } + /** + * Deletes the temporary directories used to store the + * downloaded the projects. + * + * @throws IOException + */ public synchronized void deleteTempDirs() throws IOException { - for (File tempDir : createdTempDirs) { + for (File tempDir : this.createdTempDirs) { if (tempDir.exists()) { FileUtils.deleteDirectory(tempDir); } } } + /** + * + * @param file the file to which the string will be written to + * @param data the string to be written to the file + * @throws IOException + */ public void writeStringToFile(File file, String data) throws IOException { FileUtils.writeStringToFile(file, data); } + /** + * Takes a directory and moves it to another directory + * + * @param srcDir the directory to be moved + * @param destDir the destination directory + * @throws IOException + */ public void copyDirectory(File srcDir, File destDir) throws IOException { FileUtils.copyDirectory(srcDir, destDir); + // TODO: add tests } - } \ No newline at end of file