Package org.apache.naming.resources

Examples of org.apache.naming.resources.ResourceAttributes


                try {
                    entry.source = getURL(new File(files[i], path));
                } catch (MalformedURLException e) {
                    return null;
                }
                ResourceAttributes attributes =
                    (ResourceAttributes) resources.getAttributes(fullPath);
                contentLength = (int) attributes.getContentLength();
                entry.lastModified = attributes.getLastModified();

                if (resource != null) {

                    try {
                        binaryStream = resource.streamContent();
View Full Code Here


            throw new NamingException
                (sm.getString("resources.notFound", name));
        }
       
        // Return all the attributes all the time
        ResourceAttributes attrs = new ResourceAttributes();
        attrs.setCreationDate(revisionDescriptor.getCreationDateAsDate());
        attrs.setName(getRelativeName(name));
        if (!isCollection(revisionDescriptor))
            attrs.setResourceType("");
        attrs.setContentLength(revisionDescriptor.getContentLength());
        attrs.setLastModified(revisionDescriptor.getLastModifiedAsDate());
        return attrs;

    }
View Full Code Here

        // TODO Auto-generated method stub
    }

    @Override
    protected Attributes doGetAttributes(String arg0, String[] arg1) throws NamingException {
        return new ResourceAttributes();
    }
View Full Code Here

            throw new NamingException
                (sm.getString("resources.notFound", name));
        }
       
        // Return all the attributes all the time
        ResourceAttributes attrs = new ResourceAttributes();
        attrs.setCreationDate(revisionDescriptor.getCreationDateAsDate());
        attrs.setName(getRelativeName(name));
        if (!isCollection(revisionDescriptor))
            attrs.setResourceType("");
        attrs.setContentLength(revisionDescriptor.getContentLength());
        attrs.setLastModified(revisionDescriptor.getLastModifiedAsDate());
        return attrs;

    }
View Full Code Here

                if (resources == null) {
                    // This can happen if there was an error initializing
                    // the context
                    continue;
                }
                ResourceAttributes webXmlAttributes =
                    (ResourceAttributes)
                    resources.getAttributes("/WEB-INF/web.xml");
                long newLastModified = webXmlAttributes.getLastModified();
                Long lastModified = (Long) webXmlLastModified.get(contextName);
                if (lastModified == null) {
                    webXmlLastModified.put
                        (contextName, new Long(newLastModified));
                } else {
View Full Code Here

                    entry = (ResourceEntry)AccessController.doPrivileged(dp);
                 } else {
                    entry = findResourceInternal(files[i], path);
                 }

                ResourceAttributes attributes =
                    (ResourceAttributes) resources.getAttributes(fullPath);
                contentLength = (int) attributes.getContentLength();
                entry.lastModified = attributes.getLastModified();

                if (resource != null) {

                    try {
                        binaryStream = resource.streamContent();
View Full Code Here

                }

                // Note : Not getting an exception here means the resource was
                // found

                ResourceAttributes attributes =
                    (ResourceAttributes) resources.getAttributes(fullPath);
                contentLength = (int) attributes.getContentLength();
                String canonicalPath = attributes.getCanonicalPath();
                if (canonicalPath != null) {
                    // we create the ResourceEntry based on the information returned
                    // by the DirContext rather than just using the path to the
                    // repository. This allows to have smart DirContext implementations
                    // that "virtualize" the docbase (e.g. Eclipse WTP)
                    entry = findResourceInternal(new File(canonicalPath), "");
                } else {
                    // probably a resource not in the filesystem (e.g. in a
                    // packaged war)
                    entry = findResourceInternal(files[i], path);
                }
                entry.lastModified = attributes.getLastModified();

                if (resource != null) {


                    try {
View Full Code Here

                        } catch(Exception ex) {
                            throw new IOException(ex);
                        }

                        cacheEntry.name = path;
                        cacheEntry.attributes = new ResourceAttributes();
                        cacheEntry.exists = true;
                    }
                }
            }
        }
View Full Code Here

      return null;
    }

    final ZipEntry zipEntry = entry.getEntry();

    final ResourceAttributes attrs = new ResourceAttributes();
    attrs.setCreationDate(new Date(zipEntry.getTime()));
    attrs.setName(entry.getName());
    if (!zipEntry.isDirectory()) {
      attrs.setResourceType("");
    } else {
      attrs.setCollection(true);
    }
    attrs.setContentLength(zipEntry.getSize());
    attrs.setLastModified(zipEntry.getTime());

    return attrs;

  }
View Full Code Here

                    entry = (ResourceEntry)AccessController.doPrivileged(dp);
                 } else {
                    entry = findResourceInternal(files[i], path);
                 }

                ResourceAttributes attributes =
                    (ResourceAttributes) resources.getAttributes(fullPath);
                contentLength = (int) attributes.getContentLength();
                entry.lastModified = attributes.getLastModified();

                if (resource != null) {


                    try {
View Full Code Here

TOP

Related Classes of org.apache.naming.resources.ResourceAttributes

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.