com.qoppa.pdfNotes
Class HTTPSaver

java.lang.Object
  extended by com.qoppa.pdfNotes.HTTPSaver
All Implemented Interfaces:
IPDFSaver

public class HTTPSaver
extends Object
implements IPDFSaver

This class implements a custom IPDFSaver to save a file to a URL, using the standard HTTP POST file upload protocol. The intent is to use this class when running jPDFNotes in an applet within a browser. By setting the PDFNotesBean saver to use this class, the documents will be saved back to a web server, normally the web server from where the document was loaded.

To use the class, the host application must let the PDFNotesBean object to use an instance of this object as a custom saver by calling:

notesBean.setPDFSaver (new HTTPSaver (saveURL));

On the web server, there needs to be a script to receive the file. The script can be in any language, including PHP, Java Servlet, ASP or ASP.NET, as long as it supports receiving standard file upload HTTP POST messages. You can find sample scripts on our website.

Author:
Qoppa Software

Constructor Summary
HTTPSaver(URL saveURL)
          Constructor that takes a URL to the script that will receive the file on a web server.
 
Method Summary
 boolean save(PDFNotesBean notesBean, String docName, File pdfFile)
          Implementation of the IPDFSaver.save method that sends the PDF file to the URL provided in the constructor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPSaver

public HTTPSaver(URL saveURL)
Constructor that takes a URL to the script that will receive the file on a web server.

Parameters:
saveURL - The URL of the receiving script.
Method Detail

save

public boolean save(PDFNotesBean notesBean,
                    String docName,
                    File pdfFile)
Implementation of the IPDFSaver.save method that sends the PDF file to the URL provided in the constructor.

Specified by:
save in interface IPDFSaver
Parameters:
notesBean - A reference to the PDFNotesBean object that holds the document.
docName - The name of the PDF document.
pdfFile - The file object that the PDF was opened from.
Returns:
true if successful, false otherwise