Skip to content
This repository
Browse code

Removed dep to commons-io

  • Loading branch information...
commit f22a59879777966ef160b7ba8a2c93ab154947f5 1 parent 5cea10e
authored February 17, 2011
8  src/play/modules/search/store/FilesystemStore.java
@@ -9,7 +9,6 @@
9 9
 import java.util.Map;
10 10
 import java.util.UUID;
11 11
 
12  
-import org.apache.commons.io.FileUtils;
13 12
 import org.apache.lucene.document.Document;
14 13
 import org.apache.lucene.index.IndexReader;
15 14
 import org.apache.lucene.index.IndexWriter;
@@ -23,6 +22,7 @@
23 22
 import play.db.jpa.JPA;
24 23
 import play.db.jpa.JPABase;
25 24
 import play.exceptions.UnexpectedException;
  25
+import play.libs.Files;
26 26
 import play.modules.search.Indexed;
27 27
 import play.modules.search.Search;
28 28
 
@@ -138,7 +138,7 @@ private IndexWriter getIndexWriter(String name) {
138 138
     public void rebuildAllIndexes() throws Exception {
139 139
         stop();
140 140
         File fl = new File(DATA_PATH);
141  
-        FileUtils.deleteDirectory(fl);
  141
+        Files.deleteDirectory(fl);
142 142
         fl.mkdirs();
143 143
         List<ApplicationClass> classes = Play.classes.getAnnotatedClasses(Indexed.class);
144 144
         for (ApplicationClass applicationClass : classes) {
@@ -213,7 +213,7 @@ public void rebuild(String name) {
213 213
             indexSearchers.remove(name);
214 214
             getIndexWriter(name).close();
215 215
             indexWriters.remove(name);
216  
-            FileUtils.deleteDirectory(oldFolder);
  216
+            Files.deleteDirectory(oldFolder);
217 217
             newFolder.renameTo(oldFolder);
218 218
         } catch (IOException e) {
219 219
             throw new UnexpectedException(e);
@@ -238,7 +238,7 @@ public void delete(String name) {
238 238
                 }
239 239
                 File target = new File(DATA_PATH, name);
240 240
                 if (target.exists() && target.isDirectory())
241  
-                    FileUtils.deleteDirectory(target);
  241
+                    Files.deleteDirectory(target);
242 242
             } catch (Exception e) {
243 243
                 throw new UnexpectedException("Can't reopen reader", e);
244 244
             }

0 notes on commit f22a598

Please sign in to comment.
Something went wrong with that request. Please try again.