summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/convwatch/FileHelper.java
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-09-30 07:44:27 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-09-30 07:44:27 +0000
commit122adddbef72cf66affd2c7c77f146d6b3461f9b (patch)
treeafe42e1c328dc82500cccd969b34e85ef1f6e8cf /qadevOOo/runner/convwatch/FileHelper.java
parent32bdad3936d902cf3626ceed29c2025a17ca2d0c (diff)
CWS-TOOLING: integrate CWS qadev33
Diffstat (limited to 'qadevOOo/runner/convwatch/FileHelper.java')
-rw-r--r--qadevOOo/runner/convwatch/FileHelper.java41
1 files changed, 40 insertions, 1 deletions
diff --git a/qadevOOo/runner/convwatch/FileHelper.java b/qadevOOo/runner/convwatch/FileHelper.java
index 222db6eea17a..821d4afdd98f 100644
--- a/qadevOOo/runner/convwatch/FileHelper.java
+++ b/qadevOOo/runner/convwatch/FileHelper.java
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FileHelper.java,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.8.1 $
*
* This file is part of OpenOffice.org.
*
@@ -34,6 +34,7 @@ import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.StringTokenizer;
+import helper.OSHelper;
import javax.swing.JOptionPane;
@@ -366,5 +367,43 @@ public class FileHelper
GlobalLogWriter.get().println("Message: " + e.getMessage());
}
}
+
+ /**
+ * Within the directory run through, it's possible to say which file extension types should not
+ * consider like '*.prn' because it's not a document.
+ *
+ * @return a FileFilter function
+ */
+ public static FileFilter getFileFilter()
+ {
+ FileFilter aFileFilter = new FileFilter()
+ {
+ public boolean accept( File pathname )
+ {
+ // leave out files which started by '~$' these are Microsoft Office temp files
+ if (pathname.getName().startsWith("~$"))
+ {
+ return false;
+ }
+
+ if (pathname.getName().endsWith(".prn"))
+ {
+ return false;
+ }
+ // This type of document no one would like to load.
+ if (pathname.getName().endsWith(".zip"))
+ {
+ return false;
+ }
+ // just a hack
+ if (pathname.getName().endsWith("_"))
+ {
+ return false;
+ }
+ return true;
+ }
+ };
+ return aFileFilter;
+ }
}