Package org.globus.ftp

Examples of org.globus.ftp.FileInfo


        /** Mocking server responses to prevent server failure **/

        Mockito.doReturn("testdata").when(ftpProtocol).getCurentDir();

        Vector<FileInfo> vector = new Vector<FileInfo>();
        FileInfo file = new FileInfo();
        file.setName("users.properties");
        byte b = 1;
        file.setFileType(b);
        vector.add(file);

        Mockito.doAnswer(new Answer() {
            public Object answer(InvocationOnMock invocation) {
                return null;
View Full Code Here


        final String[] childNames = new String[children.size()];
        int childNum = -1;
        Iterator<FileInfo> iterChildren = children.values().iterator();
        while (iterChildren.hasNext()) {
            childNum++;
            final FileInfo child = iterChildren.next();

            if (child.isSoftLink()) {
                String name = child.getName();
                int end = name.indexOf(" -> ");
                if (end > 0) {
                    name = name.substring(0, end);
                    childNames[childNum] = name;
                }
            } else {
                childNames[childNum] = child.getName();
            }
        }
        return childNames;
    }
View Full Code Here

                log.debug("children are present: " + childrenList.size());
                children = new TreeMap<String, FileInfo>();

                // Remove '.' and '..' elements
                for (int i = 0; i < childrenList.size(); i++) {
                    final FileInfo child = childrenList.get(i);
                    if (child == null) {
                        continue;
                    }
                    String childname = child.getName();
                    //log.debug("child: " + childname);
                    if (!".".equals(childname) && !"..".equals(childname) &&
                            !"./".equals(childname) && !"../".equals(childname)) {
                        if (child.isSoftLink()) {
                            // need to parse softlinks in order to extract just the
                            // soft link name, as the name
                            // of the soft link must be added to the list of children
                            // otherwise recursive directory listing can fail (e.g.
                            // if listing a parent dir which is itself a soft link)!
View Full Code Here


        //String pp = this.getName().getPath(); //get the parent path.
        //final GridFtpFileObject parent2 = (GridFtpFileObject) this.fileSystem.resolveFile(pp);

        FileInfo newFileInfo;
        if (parent != null) {
            // Updates this.fileInfo + parent.children by listing parent FO,
            // and extracts relevant FileInfo object in order to update
            // this.fileInfo ! In doing this, parent.children is also updated and cached.
            // (note, because getChildFile() is performed on a Parent
            // instance, no other info for 'this' class will be updated/cached,
            // e.g. this.children does not get updated). This is v.important !
            newFileInfo = parent.getChildFile(UriParser.decode(getName().getBaseName()), flush);
        } else {
            // Assume the root is a directory and exists
            newFileInfo = new FileInfo();
            newFileInfo.setName("/");
            newFileInfo.setFileType(FileInfo.DIRECTORY_TYPE);
        }
        this.fileInfo = newFileInfo;
    }
View Full Code Here

        }

        // List the children of this file
        doGetChildren();
        // Look for the requested child
        FileInfo info = this.children.get(name);
        return info;
    }
View Full Code Here

        final String[] childNames = new String[children.size()];
        int childNum = -1;
        Iterator<FileInfo> iterChildren = children.values().iterator();
        while (iterChildren.hasNext()) {
            childNum++;
            final FileInfo child = iterChildren.next();

            if (child.isSoftLink()) {
                String name = child.getName();
                int end = name.indexOf(" -> ");
                if (end > 0) {
                    name = name.substring(0, end);
                    childNames[childNum] = name;
                }
            } else {
                childNames[childNum] = child.getName();
            }
        }
        return childNames;
    }
View Full Code Here

                log.debug("children are present: " + childrenList.size());
                children = new TreeMap<String, FileInfo>();

                // Remove '.' and '..' elements
                for (int i = 0; i < childrenList.size(); i++) {
                    final FileInfo child = childrenList.get(i);
                    if (child == null) {
                        continue;
                    }
                    String childname = child.getName();
                    //log.debug("child: " + childname);
                    if (!".".equals(childname) && !"..".equals(childname) &&
                            !"./".equals(childname) && !"../".equals(childname)) {
                        if (child.isSoftLink()) {
                            // need to parse softlinks in order to extract just the
                            // soft link name, as the name
                            // of the soft link must be added to the list of children
                            // otherwise recursive directory listing can fail (e.g.
                            // if listing a parent dir which is itself a soft link)!
View Full Code Here


        //String pp = this.getName().getPath(); //get the parent path.
        //final GridFtpFileObject parent2 = (GridFtpFileObject) this.fileSystem.resolveFile(pp);

        FileInfo newFileInfo;
        if (parent != null) {
            // Updates this.fileInfo + parent.children by listing parent FO,
            // and extracts relevant FileInfo object in order to update
            // this.fileInfo ! In doing this, parent.children is also updated and cached.
            // (note, because getChildFile() is performed on a Parent
            // instance, no other info for 'this' class will be updated/cached,
            // e.g. this.children does not get updated). This is v.important !
            newFileInfo = parent.getChildFile(UriParser.decode(getName().getBaseName()), flush);
        } else {
            // Assume the root is a directory and exists
            newFileInfo = new FileInfo();
            newFileInfo.setName("/");
            newFileInfo.setFileType(FileInfo.DIRECTORY_TYPE);
        }
        this.fileInfo = newFileInfo;
    }
View Full Code Here

        }

        // List the children of this file
        doGetChildren();
        // Look for the requested child
        FileInfo info = this.children.get(name);
        return info;
    }
View Full Code Here

TOP

Related Classes of org.globus.ftp.FileInfo

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.