Package webEditor.util

Examples of webEditor.util.FileAccess


    * @return void
    */
   public void saveFile (String docName, Document doc)
   {
try {
  FileAccess  fileHandler = new FileAccess ();

  OutputFormat    format  = new OutputFormat (doc, "ISO-8859-1" ,true);
  format.setIndent (2);
  format.setLineWidth (80);
  format.setPreserveSpace (true);
  StringWriter  stringOut = new StringWriter ();
  XMLSerializer    serial = new XMLSerializer (stringOut, format);
  serial.asDOMSerializer ();

  serial.serialize (doc.getDocumentElement());

  String filePath = this.dataDir + "/news/" + docName;
  // Check if the directory structure exists...
  fileHandler.createDocDir (docName,this.dataDir + "/news/");
  // We need to delete the file before the write operation
  File fd = new File (filePath)
  if ( fd.exists() ) {
    fd.delete();
  }
View Full Code Here


    * @return void
    */
   public void saveHtmlFile (String docName, String content)
   {
try {
  FileAccess  fileHandler = new FileAccess ();

  // First at all, we expect to recive the XML name of the document,
  // so we are going to change the file extension.
  docName = this.getHTMLname (docName);

  String filePath = this.docRoot + "/news/" + docName;
  // Check if the directory structure exists...
  fileHandler.createDocDir (docName,this.docRoot + "/news/");
  // We need to delete the file before the write operation
  File fd = new File (filePath)
  if ( fd.exists() ) {
    fd.delete();
  }
View Full Code Here

    * @return void
    */
   public void saveHtmlFile (String content)
   {
try {
  FileAccess  fileHandler = new FileAccess ();

  String filePath = this.docRoot + "/index.html";
  // We need to delete the file before the write operation
  File fd = new File (filePath)
  if ( fd.exists() ) {
View Full Code Here

TOP

Related Classes of webEditor.util.FileAccess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.