Package org.apache.naming

Examples of org.apache.naming.NamingEntry


            return entries;
        String[] names = file.list();
        Arrays.sort(names);             // Sort alphabetically
        if (names == null)
            return entries;
        NamingEntry entry = null;

        for (int i = 0; i < names.length; i++) {

            File currentFile = new File(file, names[i]);
            Object object = null;
            if (currentFile.isDirectory()) {
                FileDirContext tempContext = new FileDirContext(env);
                tempContext.setDocBase(file.getPath());
                object = tempContext;
            } else {
                object = new FileResource(currentFile);
            }
            entry = new NamingEntry(names[i], object, NamingEntry.ENTRY);
            entries.addElement(entry);

        }

        return entries;
View Full Code Here


    protected Vector list(Entry entry) {
       
        Vector entries = new Vector();
        Entry[] children = entry.getChildren();
        Arrays.sort(children);
        NamingEntry namingEntry = null;
       
        for (int i = 0; i < children.length; i++) {
            ZipEntry current = children[i].getEntry();
            Object object = null;
            if (current.isDirectory()) {
                object = new WARDirContext(base, children[i]);
            } else {
                object = new WARResource(current);
            }
            namingEntry = new NamingEntry
                (children[i].getName(), object, NamingEntry.ENTRY);
            entries.addElement(namingEntry);
        }
       
        return entries;
View Full Code Here

        Vector entries = new Vector();

        Enumeration childrenNames = objectNode.enumerateChildren();

        NamingEntry entry = null;

        while (childrenNames.hasMoreElements()) {

            String childName = (String) childrenNames.nextElement();
           
            int length = objectNode.getUri().length();
            if (!objectNode.getUri().equals("/"))
                length += 1;
            String childObjectName = childName.substring(length);

            Object object = null;

            try {
               
                NodeRevisionDescriptors revisionDescriptors =
                    content.retrieve(slideToken, childName);
               
                if (revisionDescriptors.hasRevisions()) {
                   
                    // Retrieve latest revision descriptor
                    NodeRevisionDescriptor revisionDescriptor =
                        content.retrieve(slideToken, revisionDescriptors);
                   
                    if (!isCollection(revisionDescriptor)) {
                        object = new SlideResource(revisionDescriptors,
                                                   revisionDescriptor);
                    }
                   
                }

                if (object == null) {
                    object = new SlideDirContext(env, getNamespaceName(),
                                                 token, childName);
                }
               
            } catch (SlideException e) {
            }
           
            if (object != null) {
                entry = new NamingEntry(childObjectName, object,
                                        NamingEntry.ENTRY);
                entries.addElement(entry);
            }

        }
View Full Code Here

  protected List<NamingEntry> doListBindings(String name) throws NamingException {

    if ("/WEB-INF/classes".equals(name)) {
      FileDirContext fileDirContext = new FileDirContext();
      fileDirContext.setDocBase("./target/classes");
      NamingEntry namingEntry = new NamingEntry("/WEB-INF/classes", fileDirContext, -1);
      return Collections.singletonList(namingEntry);
    }

    return null;
View Full Code Here

  protected ArrayList<NamingEntry> list(final Entry entry) {

    final ArrayList<NamingEntry> entries = new ArrayList<NamingEntry>();
    final Entry[] children = entry.getChildren();
    Arrays.sort(children);
    NamingEntry namingEntry = null;

    for (int i = 0; i < children.length; i++) {
      final ZipEntry current = children[i].getEntry();
      Object object = null;
      if (current.isDirectory()) {
        object = new ZipDirContext(base, children[i]);
      } else {
        object = new WARResource(current);
      }
      namingEntry = new NamingEntry(children[i].getName(), object, NamingEntry.ENTRY);
      entries.add(namingEntry);
    }

    return entries;
View Full Code Here

  protected List<NamingEntry> doListBindings(String name) throws NamingException {

    if ("/WEB-INF/classes".equals(name)) {
      FileDirContext fileDirContext = new FileDirContext();
      fileDirContext.setDocBase("./target/classes");
      NamingEntry namingEntry = new NamingEntry("/WEB-INF/classes", fileDirContext, -1);
      return Collections.singletonList(namingEntry);
    }

    return null;
View Full Code Here

    protected ArrayList list(Entry entry) {
       
        ArrayList entries = new ArrayList();
        Entry[] children = entry.getChildren();
        Arrays.sort(children);
        NamingEntry namingEntry = null;
       
        for (int i = 0; i < children.length; i++) {
            ZipEntry current = children[i].getEntry();
            Object object = null;
            if (current.isDirectory()) {
                object = new WARDirContext(base, children[i]);
            } else {
                object = new WARResource(current);
            }
            namingEntry = new NamingEntry
                (children[i].getName(), object, NamingEntry.ENTRY);
            entries.add(namingEntry);
        }
       
        return entries;
View Full Code Here

        }

        Arrays.sort(names);             // Sort alphabetically
        if (names == null)
            return entries;
        NamingEntry entry = null;

        for (int i = 0; i < names.length; i++) {

            File currentFile = new File(file, names[i]);
            Object object = null;
            if (currentFile.isDirectory()) {
                FileDirContext tempContext = new FileDirContext(env);
                tempContext.setDocBase(file.getPath());
                tempContext.setAllowLinking(getAllowLinking());
                tempContext.setCaseSensitive(isCaseSensitive());
                object = tempContext;
            } else {
                object = new FileResource(currentFile);
            }
            entry = new NamingEntry(names[i], object, NamingEntry.ENTRY);
            entries.add(entry);

        }

        return entries;
View Full Code Here

        }

        Arrays.sort(names);             // Sort alphabetically
        if (names == null)
            return entries;
        NamingEntry entry = null;

        for (int i = 0; i < names.length; i++) {

            File currentFile = new File(file, names[i]);
            Object object = null;
            if (currentFile.isDirectory()) {
                FileDirContext tempContext = new FileDirContext(env);
                tempContext.setDocBase(file.getPath());
                tempContext.setAllowLinking(getAllowLinking());
                tempContext.setCaseSensitive(isCaseSensitive());
                object = tempContext;
            } else {
                object = new FileResource(currentFile);
            }
            entry = new NamingEntry(names[i], object, NamingEntry.ENTRY);
            entries.add(entry);

        }

        return entries;
View Full Code Here

    protected ArrayList list(Entry entry) {
       
        ArrayList entries = new ArrayList();
        Entry[] children = entry.getChildren();
        Arrays.sort(children);
        NamingEntry namingEntry = null;
       
        for (int i = 0; i < children.length; i++) {
            ZipEntry current = children[i].getEntry();
            Object object = null;
            if (current.isDirectory()) {
                object = new WARDirContext(base, children[i]);
            } else {
                object = new WARResource(current);
            }
            namingEntry = new NamingEntry
                (children[i].getName(), object, NamingEntry.ENTRY);
            entries.add(namingEntry);
        }
       
        return entries;
View Full Code Here

TOP

Related Classes of org.apache.naming.NamingEntry

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.