|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectFiles
public final class Files extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
addProjectPath(String string)
|
static void |
cat(String filename)
Prints out the contents of the give file to stdout. |
static int |
countLines(String filename)
Returns the number of lines in the given file. |
static boolean |
deleteFile(String path)
|
static boolean |
deleteRecursive(File dir)
|
static List<String> |
findFilesInDir(File dir,
String startsWith,
String endsWith)
|
static String |
getFileContents(File file)
Reads the whole file. |
static String |
getFileContents(String path)
Reads the whole file. |
static LineNumberReader |
getFileReader(File fileName)
|
static LineNumberReader |
getFileReader(String fileName)
|
static Long |
readLongFromFile(File file)
Reads a single long from the file. |
static List<String> |
readWhole(BufferedReader reader)
Reads the whole file. |
static List<String> |
readWhole(File file)
Reads the whole file. |
static List<String> |
readWhole(InputStream is)
Reads the whole file. |
static List<String> |
readWhole(String fileName)
Reads the whole file. |
static void |
writeToFile(List<String> lines,
String fileName)
|
static void |
writeToFile(String s,
File file)
|
static void |
writeToFile(String s,
File file,
Boolean append)
|
static void |
writeToFile(String s,
String fileName)
|
static void |
writeToFile(String s,
String fileName,
Boolean append)
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean deleteRecursive(File dir)
public static List<String> findFilesInDir(File dir,
String startsWith,
String endsWith)
public static void writeToFile(String s,
File file)
throws IOException
IOException
public static void writeToFile(String s,
String fileName)
throws IOException
IOException
public static void writeToFile(String s,
File file,
Boolean append)
throws IOException
IOException
public static void writeToFile(String s,
String fileName,
Boolean append)
throws IOException
IOException
public static void writeToFile(List<String> lines,
String fileName)
throws IOException
IOException
public static List<String> readWhole(BufferedReader reader)
throws IOException
IOException
public static List<String> readWhole(String fileName)
throws IOException
IOException
public static List<String> readWhole(File file)
throws IOException
IOException
public static List<String> readWhole(InputStream is)
throws IOException
IOException
public static String getFileContents(File file)
throws IOException
IOException
public static String getFileContents(String path)
throws IOException
IOExceptionpublic static LineNumberReader getFileReader(String fileName)
public static LineNumberReader getFileReader(File fileName)
public static String addProjectPath(String string)
public static boolean deleteFile(String path)
public static Long readLongFromFile(File file)
IllegalStateException - is the file contains not just 1 line or
if the file contains something.public static void cat(String filename)
public static int countLines(String filename)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||