forked from common-workflow-language/cwlviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete git repository and bundle directories on any errors
- Loading branch information
Showing
4 changed files
with
55 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.commonwl.view.util; | ||
|
||
import org.eclipse.jgit.api.Git; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* File utilities for CWL Viewer. | ||
* | ||
* <p>Uses other utilities, such as Apache Commons IO's {@code FileUtils}, but | ||
* with refinements specific for CWL Viewer (e.g. handling Git repositories).</p> | ||
*/ | ||
public class FileUtils { | ||
|
||
private FileUtils() {} | ||
|
||
public static void deleteGitRepository(Git repo) throws IOException { | ||
if (repo != null && repo.getRepository() != null && repo.getRepository().getDirectory().exists()) { | ||
org.apache.commons.io.FileUtils.forceDelete(repo.getRepository().getDirectory()); | ||
} | ||
} | ||
} |
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