core java
-
io
Get Disk Free Space
This is an example of how to get the Disk free space in Java. We are using the org.apache.commons.io.FileSystemUtils class that…
Read More » -
io
Get directory size
In this example we shall show you how to get the size of a directory. We are using the org.apache.commons.io.FileUtils class…
Read More » -
io
Create a copy of a file
With this example we are going to demonstrate how to create a copy of a file. We will make use…
Read More » -
io
Get content of a file line by line
This is an example of how to get the content of a file, line by line. We will make use…
Read More » -
io
Set content to a file
In this example we shall show you how to set the content to a File. We will make use of…
Read More » -
io
Get content of a File
With this example we are going to demonstrate how to get the content of a File. We will make use…
Read More » -
io
touch file using apache commons io example
This is an example of how to touch a file. We will make use of the org.apache.commons.io.FileUtils class, that provides…
Read More » -
lucene
Search Lucene Index
package com.javacodegeeks.lucene; import java.io.File; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory;…
Read More » -
lucene
Create Lucene Index
package com.javacodegeeks.lucene; import java.io.File; import java.io.FileReader; import java.io.IOException; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.FSDirectory; public class…
Read More » -
lucene
Did you mean feature with Apache Lucene Spell-Checker
package com.javacodegeeks.lucene.spellcheck; import java.io.File; import org.apache.lucene.search.spell.PlainTextDictionary; import org.apache.lucene.search.spell.SpellChecker; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; public class SimpleSuggestionService { public static void main(String[]…
Read More »