Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] Can file for Document be deleted?

Phill Perryman

2003-12-02



We have been using encrypted files for quite a while now and not had any problems, we do not however write out  a plain file, we build directly from the encrypt stream

                if (encrypt == true) {

                        byte[] b = { magic numbers go here };

                        // Create PBE Cipher
                        Cipher pbeCipher = createCipher(b, false);

                        FileInputStream fis = new FileInputStream(file.toString());
                        in = new CipherInputStream(fis, pbeCipher);

                } else {
                        in = new FileInputStream(file.toString());
                }
                SAXBuilder builder = new SAXBuilder();
                builder.setFactory(jdomFactory);
               doc = builder.build(in);

/Phill
IS Dept, Software Engineer.
phill_perryman@mitel.com
http://www.mitel.com
Tel: +44 1291 436023



"ÁÎÃûѧ" <mxliao@mails.gscas.ac.cn>
Sent by: jdom-interest-admin@jdom.org

02/12/2003 02:57
Please respond to "ÁÎÃûѧ"

       
        To:        jdom-interest@jdom.org
        cc:        
        Subject:        [jdom-interest] Can file for Document be deleted?



Sometimes I use an encrypted(by FlowFish) xml file to construct a Document.
Firstly I decrypt the file to a plain .xml file, then extract an instance of
Document from the plain file. Generally, for the sake of security,the plain file
should be deleted. I have done it this way and all does work. But I am not sure
whether the Document instance will be somehow affected under some certain
circumstance unknown to me.


_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com


©2008 junlu.com - Jax Systems, LLC, U.S.A.