Package org.exoplatform.services.jcr.webdav.resource

Examples of org.exoplatform.services.jcr.webdav.resource.FileResource


               resource = versionedFile.getVersionHistory().getVersion(version);
               istream = ((VersionResource)resource).getContentAsStream();
            }
            else
            {
               resource = new FileResource(uri, node, nsContext);
               istream = ((FileResource)resource).getContentAsStream();
            }

            HierarchicalProperty contentLengthProperty = resource.getProperty(FileResource.GETCONTENTLENGTH);
            long contentLength = new Long(contentLengthProperty.getValue());

            HierarchicalProperty mimeTypeProperty = resource.getProperty(FileResource.GETCONTENTTYPE);
            String contentType = mimeTypeProperty.getValue();

            FileResource fileResource = new FileResource(uri, node, nsContext);
            HierarchicalProperty lastModifiedProperty = fileResource.getProperty(FileResource.GETLASTMODIFIED);

            // content length is not present
            if (contentLength == 0)
            {
               return Response.ok().header(ExtHttpHeaders.ACCEPT_RANGES, "bytes").entity(istream).build();
View Full Code Here


         }
         else
         {
            if (ResourceUtil.isFile(node))
            {
               resource = new FileResource(uri, node, nsContext);
            }
            else
            {
               resource = new CollectionResource(uri, node, nsContext);
            }
View Full Code Here

         WebDavNamespaceContext nsContext = new WebDavNamespaceContext(session);
         URI uri = new URI(TextUtil.escape(baseURI + node.getPath(), '%', true));

         if (ResourceUtil.isFile(node))
         {
            Resource resource = new FileResource(uri, node, nsContext);

            String lastModified = resource.getProperty(PropertyConstants.GETLASTMODIFIED).getValue();
            String contentType = resource.getProperty(PropertyConstants.GETCONTENTTYPE).getValue();
            String contentLength = resource.getProperty(PropertyConstants.GETCONTENTLENGTH).getValue();

            return Response.ok().header(ExtHttpHeaders.LAST_MODIFIED, lastModified).header(ExtHttpHeaders.CONTENT_TYPE,
               contentType).header(ExtHttpHeaders.CONTENT_LENGTH, contentLength).build();
         }
View Full Code Here

            }
            else
            {
               if (ResourceUtil.isFile(nextNode))
               {
                  resource = new FileResource(uri, nextNode, nsContext);
               }
               else
               {
                  resource = new CollectionResource(uri, nextNode, nsContext);
               }
View Full Code Here

         }
         else
         {
            if (ResourceUtil.isFile(node))
            {
               resource = new FileResource(uri, node, nsContext);
            }
            else
            {
               resource = new CollectionResource(uri, node, nsContext);
            }
View Full Code Here

               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((VersionResource)resource).getContentAsStream();
            }
            else
            {
               resource = new FileResource(uri, node, nsContext);
              
               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((FileResource)resource).getContentAsStream();
            }
View Full Code Here

               lastModifiedProperty = resource.getProperty(FileResource.CREATIONDATE);
               istream = ((VersionResource)resource).getContentAsStream();
            }
            else
            {
               resource = new FileResource(uri, node, nsContext);
              
               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((FileResource)resource).getContentAsStream();
            }
View Full Code Here

              
               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
            }
            else
            {
               resource = new FileResource(uri, node, nsContext);
              
               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
            }

            // check before any other reads
View Full Code Here

               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((VersionResource)resource).getContentAsStream();
            }
            else
            {
               resource = new FileResource(uri, node, nsContext);
              
               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((FileResource)resource).getContentAsStream();
            }
View Full Code Here

            }
            else
            {
               if (ResourceUtil.isFile(nextNode))
               {
                  resource = new FileResource(uri, nextNode, nsContext);
               }
               else
               {
                  resource = new CollectionResource(uri, nextNode, nsContext);
               }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.webdav.resource.FileResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.