Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 59495 invoked from network); 4 Sep 2008 16:21:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2008 16:21:57 -0000 Received: (qmail 920 invoked by uid 500); 4 Sep 2008 16:21:54 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 663 invoked by uid 500); 4 Sep 2008 16:21:54 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 652 invoked by uid 99); 4 Sep 2008 16:21:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 09:21:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aklimets@day.com designates 207.126.148.183 as permitted sender) Received: from [207.126.148.183] (HELO eu3sys201aog003.obsmtp.com) (207.126.148.183) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 04 Sep 2008 16:20:53 +0000 Received: from source ([209.85.198.248]) by eu3sys201aob003.postini.com ([207.126.154.11]) with SMTP; Thu, 04 Sep 2008 16:21:22 UTC Received: by rv-out-0708.google.com with SMTP id k29so25057rvb.6 for ; Thu, 04 Sep 2008 09:21:22 -0700 (PDT) Received: by 10.141.172.6 with SMTP id z6mr5860482rvo.47.1220545282044; Thu, 04 Sep 2008 09:21:22 -0700 (PDT) Received: by 10.141.128.14 with HTTP; Thu, 4 Sep 2008 09:21:21 -0700 (PDT) Message-ID: Date: Thu, 4 Sep 2008 18:21:21 +0200 From: "Alexander Klimetschek" To: users@jackrabbit.apache.org Subject: Re: Webdav issue In-Reply-To: <77CADC03CB19CD4D8F0628866188769559DB45A5AD@IGTEBLREXCH02.igatecorp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <77CADC03CB19CD4D8F0628866188769559DB45A5AD@IGTEBLREXCH02.igatecorp.com> X-Virus-Checked: Checked by ClamAV on apache.org Are you using the SimpleWebdavServlet? I think it is the one that provides a folder/file based mapping (onto nt:folder/nt:file), others might show all the nodes. Regards, Alex On Thu, Sep 4, 2008 at 12:14 PM, Gandhirajan Natarajan wrote: > Hi, > > I have an issue in Webdav access.Actually, when I add some document (eg. Tiff files) in default repository and view it in web browser using Webdav functionality, the file is getting opened as an folder structure instead of opening as a file.Please advice me on this. > > My code snippet is as follows: > > Session session = null; > > InitialContext ctx = new InitialContext(); > > Repository repository = (Repository) ctx > .lookup("jcr/local"); > > System.out.println("jackrabbit repository found!" > + repository); > > Credentials cred = new SimpleCredentials("user", > new char[] { 'p', 'w', 'd' }); > > session = repository.login(cred); > > System.out.println("Login Successful!" > + session.getUserID()); > File file = new File( > "C:\\ Original Image.tif"); > System.out.println("File Content length - " > + file.length()); > MimeTable mt = MimeTable.getDefaultTable(); > String mimeType = mt.getContentTypeFor(file > .getName()); > > System.out.println("MIME Type - " + mimeType); > if (mimeType == null) > mimeType = "application/octet-stream"; > > Node root = session.getRootNode(); > > > Node fileNode = root.addNode(file.getName(), > "nt:file"); > Node resNode = fileNode.addNode("jcr:content", > "nt:resource"); > resNode.setProperty("jcr:mimeType", mimeType); > resNode.setProperty("jcr:data", > new FileInputStream(file)); > resNode.setProperty("jcr:encoding", ""); > Calendar lastModified = Calendar.getInstance(); > lastModified.setTimeInMillis(file.lastModified()); > resNode.setProperty("jcr:lastModified", > lastModified); > > session.save(); > > > I had this issue previously. Even I made some necessary changes in the config.xml as well. But still I couldn't resolve the issue. > > Please advice. > > Thanks & Regards, > Gandhi Rajan.N > ________________________________ > | iSIGHT Development Team | iGATE Global Solutions| T: +91-80-4104 1308| M: +91 9886834626 | gandhirajan.natarajan@igate.com | > | 158-162 & 165-170 EPIP Phase II Whitefield Bangalore - 560 066 India | www.igate.com | > > iGATE is Ranked No. 3 in DQ-IDC best IT employer survey and Ranked No.6 > by Business Today-Mercer Human Resource Consulting-TNS in a cross industry survey of Best Companies to work for in India > ----------------------------------------------------------------DISCLAIMER--------------------------------------------------------- > Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended for use only by the individual > or entity to whom it is addressed and may contain information that is privileged, confidential, or exempt from disclosure under > applicable law. If you are not the intended recipient of this EMAIL immediately notify the sender at iGATE or mailadmin@igate.com > and delete this EMAIL including any attachments > -- Alexander Klimetschek alexander.klimetschek@day.com