Permalink
Browse files

Removed dep to commons-io

  • Loading branch information...
1 parent 5cea10e commit f22a59879777966ef160b7ba8a2c93ab154947f5 Jean-Francois POUX committed Feb 17, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/play/modules/search/store/FilesystemStore.java
@@ -9,7 +9,6 @@
import java.util.Map;
import java.util.UUID;
-import org.apache.commons.io.FileUtils;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -23,6 +22,7 @@
import play.db.jpa.JPA;
import play.db.jpa.JPABase;
import play.exceptions.UnexpectedException;
+import play.libs.Files;
import play.modules.search.Indexed;
import play.modules.search.Search;
@@ -138,7 +138,7 @@ private IndexWriter getIndexWriter(String name) {
public void rebuildAllIndexes() throws Exception {
stop();
File fl = new File(DATA_PATH);
- FileUtils.deleteDirectory(fl);
+ Files.deleteDirectory(fl);
fl.mkdirs();
List<ApplicationClass> classes = Play.classes.getAnnotatedClasses(Indexed.class);
for (ApplicationClass applicationClass : classes) {
@@ -213,7 +213,7 @@ public void rebuild(String name) {
indexSearchers.remove(name);
getIndexWriter(name).close();
indexWriters.remove(name);
- FileUtils.deleteDirectory(oldFolder);
+ Files.deleteDirectory(oldFolder);
newFolder.renameTo(oldFolder);
} catch (IOException e) {
throw new UnexpectedException(e);
@@ -238,7 +238,7 @@ public void delete(String name) {
}
File target = new File(DATA_PATH, name);
if (target.exists() && target.isDirectory())
- FileUtils.deleteDirectory(target);
+ Files.deleteDirectory(target);
} catch (Exception e) {
throw new UnexpectedException("Can't reopen reader", e);
}

0 comments on commit f22a598

Please sign in to comment.