From 159661d202e3e9e8baab92ce467b0695d0360fca Mon Sep 17 00:00:00 2001 From: Brian Rosenberger Date: Tue, 5 Feb 2013 14:21:39 +0000 Subject: [PATCH] Arbeitsstand Anfang Februar git-svn-id: https://brutex.net/svn/xservices/trunk@107 e7e49efb-446e-492e-b9ec-fcafc1997a86 --- .../xservices/types/FileInfoListType.java | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/java/net/brutex/xservices/types/FileInfoListType.java diff --git a/src/java/net/brutex/xservices/types/FileInfoListType.java b/src/java/net/brutex/xservices/types/FileInfoListType.java deleted file mode 100644 index 0235430..0000000 --- a/src/java/net/brutex/xservices/types/FileInfoListType.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.brutex.xservices.types; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -public class FileInfoListType { - - private List list = new ArrayList(); - - public void setDirectory(File dir, final boolean withDirectories, final boolean withFiles, int depth) { - if(depth <=0) return; - - File[] files = dir.listFiles(new FileFilter() { - - public boolean accept(File pathname) { - if(!withFiles && !pathname.isFile()) return false; - return true; - } - }); - if(files==null) return; - for( File e : files) { - if(e.isDirectory()) setDirectory(e, withDirectories, withFiles, depth-1); - if( (withDirectories && e.isDirectory()) - || withFiles && e.isFile()) { - this.list.add(new FileInfoType(e)); - } - } - } - - public void setDirectory(String dir, final boolean withDirectories, final boolean withFiles, int depth) { - setDirectory( (new File(dir)), withDirectories, withFiles, depth); - } - - - - @XmlElement(name="FileInfoList") - public List getFiles() { - return list; - } - -}