mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
implementing HgRepositoryManager
This commit is contained in:
@@ -10,6 +10,7 @@ package sonia.scm.util;
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -49,6 +50,35 @@ public class Util
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param file
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void delete(File file) throws IOException
|
||||
{
|
||||
if (file.isDirectory())
|
||||
{
|
||||
File[] children = file.listFiles();
|
||||
|
||||
if (children != null)
|
||||
{
|
||||
for (File child : children)
|
||||
{
|
||||
delete(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!file.delete())
|
||||
{
|
||||
throw new IOException("could not delete file ".concat(file.getPath()));
|
||||
}
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user