List of utility methods to do File Create
void | createChecksum(String path) Stores the checksum of a given directory tree in a file at the root of that directory. long checksum_long = computeChecksum(path); byte[] checksum = String.valueOf(checksum_long).getBytes(); File f = new File(getDir(path), CHECKSUM_FILENAME); FileOutputStream os = new FileOutputStream(f); os.write(checksum); os.close(); |
void | createFile(File file, boolean isFile) create File if (!file.exists()) { if (!file.getParentFile().exists()) { createFile(file.getParentFile(), false); } else { if (isFile) { try { file.createNewFile(); } catch (IOException e) { ... |
void | createFile(String file, String content, String encodType) create File FileOutputStream writerStream = new FileOutputStream(file); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( writerStream, encodType)); writer.write(content); writer.close(); writerStream.close(); |
void | createFile(String fileName) create File File file = new File(fileName); if (!file.exists()) { if (!file.createNewFile()) throw new IOException("Create file fail!"); |
FileOutputStream | createFile(String fileName) Create a FileOutputStream corresponding to a particular file name. if (fileName == null) { throw new IllegalArgumentException("null file"); File f = new File(fileName); if (f.getParentFile() != null && !f.getParentFile().exists()) { boolean result = f.getParentFile().mkdirs(); if (!result) { throw new IOException("failed to create " ... |
void | createFile(String filePathAndName, String fileContent) create File try { String filePath = filePathAndName; filePath = filePath.toString(); File myFilePath = new File(filePath); if (!myFilePath.exists()) { myFilePath.createNewFile(); } catch (Exception e) { ... |
File | createFile(String path) Procedure for creating a File File file = new File(path); if (!file.exists()) { try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); return file; |
boolean | createFile(String path) create File File file = new File(path); try { if (file.exists()) { if (file.delete()) { file.createNewFile(); } else { file.createNewFile(); ... |
void | createFile(String path, List create File File arq = null;
arq = new File(path);
write(arq, content);
|
boolean | createFile(String path, String content) create File try { File arch = null; arch = new File(path); BufferedWriter wtr = new BufferedWriter(new FileWriter(arch)); wtr.write(content); wtr.flush(); wtr.close(); arch.setWritable(true); ... |