KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > clipbuilder > html > util > FileUtilities


1 package org.jahia.clipbuilder.html.util;
2
3 import java.io.*;
4
5 /**
6  * File Utilities
7  *
8  *@author Tlili Khaled
9  */

10 public class FileUtilities {
11
12     /**
13      * Description of the Method
14      *
15      *@param fileName Description of Parameter
16      *@param html Description of Parameter
17      */

18     public static void writeIntoFile(String JavaDoc fileName, String JavaDoc html) {
19         File f = new File(fileName);
20         try {
21             f.createNewFile();
22             java.io.FileWriter JavaDoc fWriter = new FileWriter(f);
23             fWriter.write(html);
24         }
25         catch (IOException ex) {
26             ex.printStackTrace();
27         }
28     }
29
30
31     /**
32      * Description of the Method
33      *
34      *@param fileName Description of Parameter
35      *@return Description of the Returned Value
36      */

37     public static boolean deleteFile(String JavaDoc fileName) {
38         File f = new File(fileName);
39         return f.delete();
40     }
41 }
42
Popular Tags