Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in Java FTP by (140 points)
I thing it would be good to include a getAbsolutePath() and getHost() methods in the FTPFile class so the data can be retrieved to display the path in say a status/addressbar or it can be used to initiate a download from say a table etc.

/** Creates a new FTPFile instance by converting the
     * given pathname string into an abstract pathname. */
    public FTPFile(String path) {
        if (path.compareTo("/") != 0 && path.endsWith("/"))
            this.path = path.substring(0, path.length() - 1);
        else
            this.path = path;
    }

    /** Creates a new FTPFile instance from a parent
     * pathname string and a child pathname string. */
    public FTPFile(String parent, String name) {
        if (parent.endsWith("/"))
            this.path = parent + name;
        else
            this.path = parent + "/" + name;
    }

    /** Creates a new FTPFile instance from a parent
     * abstract pathname and a child pathname string. */
    public FTPFile(FTPFile dir, String name) {
        this(dir.getAbsolutePath(), name);
    }

2 Answers

0 votes
by
Thanks for the suggestion. We'll put it down as an enhancement request for possible inclusion in 1.4.0

I thing it would be good to include a getAbsolutePath() and getHost() methods in the FTPFile class so the data can be retrieved to display the path in say a status/addressbar or it can be used to initiate a download from say a table etc.
0 votes
by (240 points)
Hi,

String getAbsolutePath()
String getHost()
FTPFile getParent()

would be really usefull !
Do you plan to implement it in next releases ?

(For the moment i'm using a simple workaround, a Hashtable where the keys are the FTPFile and values are the absolute path ...)

Thanks ;) !

Cheers,
Nico.

Categories

...