import java.io.File;
public class DeleteSvn {
/**
* @param args
*/
public static void main(String[] args) {
String a = args[0];
if (a == null || a.trim().length() == 0) {
System.out.println("input error args.");
return;
}
File file = new File(a);
if (file.isFile()) {
System.out.println(a + "is a file.");
return;
}
process(file);
}
private static void process(File file) {
File[] fs = file.listFiles();
if (fs != null) {
for (File f : fs) {
if (f.isDirectory()) {
if (".svn".equalsIgnoreCase(f.getName())) {
deleteFile(f);
f.delete();
} else {
process(f);
}
}
}
}
}
private static void deleteFile(File file) {
File[] fs = file.listFiles();
if (fs != null) {
for (File f : fs) {
if (f.isDirectory()) {
deleteFile(f);
f.delete();
} else {
if (f.delete()) {
System.out.println(f.getAbsolutePath() + "is delete sucessful.");
} else {
System.out.println(f.getAbsolutePath() + "is delete unsucessful.");
}
}
}
}
}
}
public class DeleteSvn {
/**
* @param args
*/
public static void main(String[] args) {
String a = args[0];
if (a == null || a.trim().length() == 0) {
System.out.println("input error args.");
return;
}
File file = new File(a);
if (file.isFile()) {
System.out.println(a + "is a file.");
return;
}
process(file);
}
private static void process(File file) {
File[] fs = file.listFiles();
if (fs != null) {
for (File f : fs) {
if (f.isDirectory()) {
if (".svn".equalsIgnoreCase(f.getName())) {
deleteFile(f);
f.delete();
} else {
process(f);
}
}
}
}
}
private static void deleteFile(File file) {
File[] fs = file.listFiles();
if (fs != null) {
for (File f : fs) {
if (f.isDirectory()) {
deleteFile(f);
f.delete();
} else {
if (f.delete()) {
System.out.println(f.getAbsolutePath() + "is delete sucessful.");
} else {
System.out.println(f.getAbsolutePath() + "is delete unsucessful.");
}
}
}
}
}
}