Package net.sf.jftp.gui.base.dir

Examples of net.sf.jftp.gui.base.dir.DirEntry


            if(!path.trim().equals(""))
            {
                ((LocalDir) localDir).chdir(path);
            }

            ((LocalDir) localDir).startTransfer(new DirEntry(name,
                                                             ((ActionListener) localDir)));
        }
        else
        {
            Log.debug("Dragging multiple files or dirs is not yet supported.");
View Full Code Here


            UpdateDaemon.updateCall();
        }

//        downloads.put(file, message);
       
    DirEntry d = null;
    if(downloads.containsKey(message)) {
      d = (DirEntry) downloads.get(message);
    }
    else {
      d = new DirEntry(message, null);
      d.setNoRender();
      if(getFile(tmp).endsWith("/"))
      {
        d.setDirectory();
      }
      d.setFileSize(size);
    }

    d.setTransferred(bytes);
     
    downloads.put(file, d);

        updateArea();
    }
View Full Code Here

            f[i] = (DirEntry) o;
          }
          else {

            String tmp = (String) o;
            DirEntry d = new DirEntry(tmp, null);

            if(getFile(tmp).endsWith("/"))
            {
              d.setDirectory();
            }

            d.setNoRender();
              f[i] = d;
          }

          i++;
        }
View Full Code Here

                    if(tmp.indexOf("X-File") >= 0)
                    {
                        tmp = parse(tmp);
                        fileNames.add(tmp);

                        DirEntry entry = new DirEntry(tmp.substring(tmp.lastIndexOf("/") +
                                                                    1), this);
                        entry.setFile();

                        tmp = in.readLine();

                        if(tmp.indexOf("X-Size") >= 0)
                        {
                            tmp = parse(tmp);
                            entry.setFileSize(Long.parseLong(tmp));
                        }
                        else if(tmp == null)
                        {
                            return;
                        }
View Full Code Here

    */
    public void setDirList(boolean fakeInit)
    {
        jlm = new DefaultListModel();

        DirEntry dwn = new DirEntry("..", this);
        dwn.setDirectory();
        jlm.addElement(dwn);

        if(!fakeInit)
        {
            if(pathChanged)
            {
                pathChanged = false;

                //TODO .debug("before DirLister");
                DirLister dir = new DirLister(con, sortMode);

                while(!dir.finished)
                {
                    LocalIO.pause(10);
                }

                if(dir.isOk())
                {
                    //TODO .debug("dir is ok");
                    length = dir.getLength();
                    dirEntry = new DirEntry[length];
                    files = dir.list();

                    String[] fSize = dir.sList();
                    int[] perms = dir.getPermissions();

                    // --------- sorting aphabetically ------------
                    // is now in DirLister

                    /*
                                        if(Settings.sortDir)
                                        {
                                            String[] tmpx = new String[length];

                                            //if(fSize != null) System.out.println(":"+length+":"+fSize.length+":"+files.length);
                                            int pLength = length;

                                            if(perms != null)
                                            {
                                                pLength = perms.length;
                                            }

                                            //System.out.println(files.length + ":" + fSize.length+":"+ pLength + ":"+ length);
                                            if((fSize.length != files.length) ||
                                                   (pLength != files.length) ||
                                                   (length != files.length))
                                            {
                                                System.out.println("Sort mismatch - hopefully ignoring it...");
                                            }

                                            for(int x = 0; x < length; x++)
                                            {
                                                if(perms != null)
                                                {
                                                    tmpx[x] = files[x] + "@@@" + fSize[x] + "@@@" +
                                                              perms[x];
                                                }
                                                else
                                                {
                                                    Log.out("permissions  are skipped");
                                                    tmpx[x] = files[x] + "@@@" + fSize[x];
                                                }
                                            }

                                            LocalIO.sortStrings(tmpx);

                                            for(int y = 0; y < length; y++)
                                            {
                                                files[y] = tmpx[y].substring(0,
                                                                             tmpx[y].indexOf("@@@"));

                                                String tmp = tmpx[y].substring(tmpx[y].indexOf("@@@") +
                                                                               3);

                                                if(tmp.indexOf("@@@") > 0)
                                                {
                                                    fSize[y] = tmp.substring(0,
                                                                             tmp.lastIndexOf("@@@"));
                                                }
                                                else
                                                {
                                                    fSize[y] = tmp;
                                                }

                                                if(perms != null)
                                                {
                                                    perms[y] = Integer.parseInt(tmpx[y].substring(tmpx[y].lastIndexOf("@@@") +
                                                                                                  3));
                                                }
                                            }
                                        }
                    */

                    // ----------- end sorting --------------------
                    for(int i = 0; i < length; i++)
                    {
                        //System.out.println(files[i]);
                        if((files == null) || (files[i] == null))
                        {
                            //System.out.println("Critical error, files or files[i] is null!\nPlease report when and how this happened...");
                            System.out.println("skipping setDirList, files or files[i] is null!");

                            return;

                            //System.exit(0);
                        }

                        //Log.debug("adding: " + files[i]);
                        dirEntry[i] = new DirEntry(files[i], this);

                        if(dirEntry[i] == null)
                        {
                            System.out.println("\nskipping setDirList, dirEntry[i] is null!");

View Full Code Here

    */
    public void setDirList(boolean fakeInit)
    {
        jlm = new DefaultListModel();

        DirEntry dwn = new DirEntry("..", this);
        dwn.setDirectory();
        jlm.addElement(dwn);

        if(!fakeInit)
        {
            if(pathChanged)
            {
                pathChanged = false;

                DirLister dir = new DirLister(con, sortMode, Settings.getHideLocalDotNames());

                while(!dir.finished)
                {
                    LocalIO.pause(10);
                }

                if(dir.isOk())
                {
                    length = dir.getLength();
                    dirEntry = new DirEntry[length];
                    files = dir.list();

                    String[] fSize = dir.sList();
                    int[] perms = dir.getPermissions();

                    // --------- sorting aphabetically ------------
                    // is now in DirLister

                    /*
                                        if(Settings.sortDir)
                                        {
                                            String[] tmpx = new String[length];

                                            //if(fSize != null) System.out.println(":"+length+":"+fSize.length+":"+files.length);
                                            int pLength = length;

                                            if(perms != null)
                                            {
                                                pLength = perms.length;
                                            }

                                            //System.out.println(files.length + ":" + fSize.length+":"+ pLength + ":"+ length);
                                            if((fSize.length != files.length) ||
                                                   (pLength != files.length) ||
                                                   (length != files.length))
                                            {
                                                System.out.println("Sort mismatch - hopefully ignoring it...");
                                            }

                                            for(int x = 0; x < length; x++)
                                            {
                                                if(perms != null)
                                                {
                                                    tmpx[x] = files[x] + "@@@" + fSize[x] + "@@@" +
                                                              perms[x];
                                                }
                                                else
                                                {
                                                    tmpx[x] = files[x] + "@@@" + fSize[x];
                                                }
                                            }

                                            LocalIO.sortStrings(tmpx);

                                            for(int y = 0; y < length; y++)
                                            {
                                                files[y] = tmpx[y].substring(0,
                                                                             tmpx[y].indexOf("@@@"));

                                                String tmp = tmpx[y].substring(tmpx[y].indexOf("@@@") +
                                                                               3);
                                                fSize[y] = tmp.substring(0, tmp.lastIndexOf("@@@"));

                                                if(perms != null)
                                                {
                                                    perms[y] = Integer.parseInt(tmpx[y].substring(tmpx[y].lastIndexOf("@@@") +
                                                                                                  3));
                                                }
                                            }
                                        }
                    */

                    // ----------- end sorting --------------------
                    for(int i = 0; i < length; i++)
                    {
                        if((files == null) || (files[i] == null))
                        {
                            //System.out.println("Critical error, files or files[i] is null!\nPlease report when and how this happened...");
                            System.out.println("skipping setDirList, files or files[i] is null!");

                            return;

                            //System.exit(0);
                        }

                        dirEntry[i] = new DirEntry(files[i], this);

                        if(dirEntry[i] == null)
                        {
                            System.out.println("\nskipping setDirList, dirEntry[i] is null!");

View Full Code Here

TOP

Related Classes of net.sf.jftp.gui.base.dir.DirEntry

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.