Beispiel #1
0
        public Gen::List <SftpFileInfo> SetList(string path, java::util.Vector entries)
        {
            string dir = path;

            if (!dir.EndsWith("/"))
            {
                dir += "/";
            }

            System.DateTime          dt   = System.DateTime.Now;
            Gen::List <SftpFileInfo> list = new Gen::List <SftpFileInfo>();

            foreach (jsch::ChannelSftp.LsEntry entry in entries)
            {
                string filename = entry.getFilename();
                if (filename == ".")
                {
                    string       filepath = path;
                    SftpFileInfo item     = new SftpFileInfo(operation, filepath, entry.getAttrs(), dt);
                    this.InternalSetAttr(item);
                }
                else if (filename == "..")
                {
                    continue;
                }
                else
                {
                    string       filepath = dir + filename;
                    SftpFileInfo item     = new SftpFileInfo(operation, filepath, entry.getAttrs(), dt);
                    list.Add(item);
                    this.InternalSetAttr(item);
                }
            }
            diclist[path] = new lsres_t(list, dt);

            this.DiscardOld();
            return(list);
        }
Beispiel #2
0
 void InternalSetAttr(SftpFileInfo attr)
 {
     lock (sync_root) dicattr[attr.Filepath] = attr;
 }
Beispiel #3
0
 void InternalSetAttr(string path, jsch::SftpATTRS attr)
 {
     lock (sync_root) dicattr[path] = new SftpFileInfo(operation, path, attr);
 }