Package org.apache.naming.resources

Examples of org.apache.naming.resources.ResourceAttributes


                        }

                        item.setLevel(level);
                        item.setCompileTime(-1);
                        try {
                            ResourceAttributes jspAttributes = (ResourceAttributes) ctx.getResources().getAttributes(name);
                            item.setSize(jspAttributes.getContentLength());
                            item.setLastModified(jspAttributes.getLastModified());
                        } catch (NamingException e) {
                            logger.error("Cannot lookup attributes for " + name);
                        }

View Full Code Here


            entry = treeLookup(name);
        }
        if (entry == null)
            throw new NamingException(sm.getString("resources.notFound", name));

        ResourceAttributes attrs = new ResourceAttributes();
        attrs.setCreationDate(new Date(entry.getLastModified()));
        attrs.setName(entry.getName());
        if (entry.isFile())
            attrs.setResourceType("");
        attrs.setContentLength(entry.getSize());
        attrs.setLastModified(entry.getLastModified());

        return attrs;

    }
View Full Code Here

            }
            if (exists) {
                try {
                    attributes = resources.getAttributes(path);
                    if (attributes instanceof ResourceAttributes) {
                        ResourceAttributes tempAttrs =
                            (ResourceAttributes) attributes;
                        Date tempDate = tempAttrs.getCreationDate();
                        if (tempDate != null)
                            creationDate = tempDate.getTime();
                        tempDate = tempAttrs.getLastModifiedDate();
                        if (tempDate != null) {
                            httpDate = FastHttpDateFormat.getDate(tempDate);
                            date = tempDate.getTime();
                        } else {
                            httpDate = FastHttpDateFormat.getCurrentDate();
                        }
                        weakETag = tempAttrs.getETag();
                        strongETag = tempAttrs.getETag(true);
                        length = tempAttrs.getContentLength();
                    }
                } catch (NamingException e) {
                    // Shouldn't happen, the implementation of the DirContext
                    // is probably broken
                    exists = false;
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

                    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

                    entry.source = getURL(new File(files[i], path));
                    entry.codeBase = entry.source;
                } 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

                // Note : Not getting an exception here means the resource was
                // found
                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

                // Note : Not getting an exception here means the resource was
                // found
                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

                    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

        }
        if (entry == null)
            throw new NamingException
                (sm.getString("resources.notFound", name));
       
        ResourceAttributes attrs = new ResourceAttributes();
        try {
            attrs.setCreationDate(new Date(entry.getLastModified()));
            attrs.setName(entry.getName());
            if (isFile(entry))
                attrs.setResourceType("");
            attrs.setContentLength(entry.getSize());
            attrs.setLastModified(entry.getLastModified());
        } catch (IOException e) {
            NamingException ex = new NamingException
            (sm.getString("resources.notFound", name));
            ex.initCause(e);
            throw ex;
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.