jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gandhirajan Natarajan" <Gandhirajan.Natara...@igate.com>
Subject Accessing tiff file using webdav
Date Tue, 13 May 2008 11:55:22 GMT
 

Hi,

 

I am still facing this issue. Please help me out.

 

I am trying to add a tiff file in 'default' workspace of Jackrabbit. And
my code snippet is as follows:-

 

Credentials cred = new SimpleCredentials("user",

                new char[] { 'p', 'w', 'd' });

 

        session = repository.login(cred);

 

        File file = new File(

                "C:\\ Image.tif");

        MimeTable mt = MimeTable.getDefaultTable();

        String mimeType = mt.getContentTypeFor(file

                .getName());

 

        if (mimeType == null)

            mimeType = "application/octet-stream";

 

        

        Node root = session.getRootNode();

        Node tiffNode = root.addNode(file.getName(),

                "nt:folder");

 

        Node fileNode = tiffNode.addNode(file.getName(),

                "nt:file");

        Node resNode = fileNode.addNode("jcr:content",

                "nt:resource");

        resNode.setProperty("jcr:mimeType", mimeType);

        resNode.setProperty("jcr:encoding", "");

        resNode.setProperty("jcr:data",

                new FileInputStream(file));

        Calendar lastModified = Calendar.getInstance();

        lastModified.setTimeInMillis(file.lastModified());

        resNode.setProperty("jcr:lastModified",

                lastModified);

 

        session.save();

        

 

Actually, I am able to add the tiff file to the workspace by using the
code above. But my problem is when I am trying to access this tiff file
via browser (using webdav functionality), the tiff file is not opening
up (i.e its not asking for an option to save or open) instead it opens
up like a folder structure in browser (/default/Original
Image.tif/Original Image.tif/jcr:content).

 

But I want to get the actual tiff file via browser using webdav.How do I
do that?

 

Please advice...

 

Thanks & Regards,

Gandhi Rajan.N

 

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message