Java Utililty Methods Dump File

List of utility methods to do Dump File

Description

The list of methods to do Dump File are organized into topic(s).

Method

voiddumpFile(final Reader rdr)
dump File
dumpFile(System.out, rdr);
byte[]dumpFile(String filename)
Dump a file content to an array of bytes.
return dumpFile(new File(filename));
voiddumpFile(String filename)
dump File
File file = new File(filename);
FileInputStream input = new FileInputStream(file);
byte[] data = new byte[(int) file.length()];
input.read(data);
System.out.println(filename + ":");
dump(data);
voiddumpToFile(String dest, String content)
dump To File
FileWriter writer = new FileWriter(dest);
writer.write(content);
writer.close();
voiddumpToFile(String fileName, String buffer, boolean append)
dump To File
dumpToFile(fileName, buffer, append, "");
voiddumpToFile(String name, String string)
dump To File
File file = new File(name);
File parentFile = file.getParentFile();
if (parentFile.exists() == false) {
    if (parentFile.mkdirs() == false)
        throw new IOException("Unable to create directories for " + parentFile.getAbsoluteFile());
FileWriter writer = new FileWriter(file);
writer.write(string);
...
FiledumptoTempFile(List lineItems)
dumpto Temp File
File createTempFile = File.createTempFile("brule", "log");
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(createTempFile)));
for (String line : lineItems) {
    writer.write(line);
    writer.newLine();
writer.close();
return createTempFile;
...
voiddumpToTemporaryFile(String modifiedSource, String modifiedPythonFile)
dump To Temporary File
try {
    FileWriter writer = new FileWriter(new File(modifiedPythonFile));
    writer.write(modifiedSource.toString());
    writer.close();
} catch (IOException e1) {
    e1.printStackTrace();