Package org.aksw.iguana.cc.utils
Class FileUtils
- java.lang.Object
-
- org.aksw.iguana.cc.utils.FileUtils
-
public class FileUtils extends java.lang.Object
Methods to work easier with Files.- Author:
- f.conrads
-
-
Constructor Summary
Constructors Constructor Description FileUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
countLines(java.io.File filename)
Counts the lines in a file efficently Props goes to: http://stackoverflow.com/a/453067/2917596static int
getHashcodeFromFileContent(java.lang.String filepath)
static java.lang.String
readFile(java.lang.String path)
static java.lang.String
readLineAt(int pos, java.io.File filename)
Returns a line at a given position of a File
-
-
-
Method Detail
-
countLines
public static int countLines(java.io.File filename) throws java.io.IOException
Counts the lines in a file efficently Props goes to: http://stackoverflow.com/a/453067/2917596- Parameters:
filename
- File to count lines of- Returns:
- No. of lines in File
- Throws:
java.io.IOException
-
readLineAt
public static java.lang.String readLineAt(int pos, java.io.File filename) throws java.io.IOException
Returns a line at a given position of a File- Parameters:
pos
- line which should be returnedfilename
- File in which the queries are stated- Returns:
- line at pos
- Throws:
java.io.IOException
-
getHashcodeFromFileContent
public static int getHashcodeFromFileContent(java.lang.String filepath)
-
readFile
public static java.lang.String readFile(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
-