jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalka, Edyta" <Edyta.Ka...@pl.compuware.com>
Subject file import with the webdav-jcr interface without transaction lock/unlock?
Date Wed, 20 Dec 2006 13:46:25 GMT

Is there a way to obtain file import with the use of webdav interface?

By file import I understand something equivalent to the following calls
using jcr api:
public Node importFile (Node folderNode, File file, String mimeType,
            String encoding) throws RepositoryException, IOException
        //create the file node - see section of the spec
        Node fileNode = folderNode.addNode (file.getName (), "nt:file");
        //create the mandatory child node - jcr:content
        Node resNode = fileNode.addNode ("jcr:content", "nt:resource");
        resNode.setProperty ("jcr:mimeType", mimeType);
        resNode.setProperty ("jcr:encoding", encoding);
        resNode.setProperty ("jcr:data", new FileInputStream (file));
        Calendar lastModified = Calendar.getInstance ();
        lastModified.setTimeInMillis (file.lastModified ());
        resNode.setProperty ("jcr:lastModified", lastModified);

        return fileNode;

How to add such nested node set if I don't have transaction lock/unlock
supported (see my previous post: 
-abort-the-transaction-tf2858874.html ) ?

Best regards
The contents of this e-mail are intended for the named addressee only. It contains information
that may be confidential. Unless you are the named addressee or an authorized designee, you
may not copy or use it, or disclose it to anyone else. If you received it in error please
notify us immediately and then destroy it. 

View raw message