I’m trying to access files on an FTP server embedded in specialised hardware with the Apache Commons Net library. For some reason listNames() works, but listFiles() does not. The documentation for the hardware is very limited, but it does at least say that active mode has to be used. Connection to the hardware is made over a local WiFi network
Tag: ftp
Ideas for listing files, directories, sub files & sub directories without recursion in ftp server
I’m trying to produce file listing of a given directory and it’s sub directories in a ftp server. The server works fine, and I have been successfully able to produce the file listing of the current directory. When I try to list the subdirectories and their files is where it gets complicated. I was asked not to use a recursion
Apache Commons FTP Passive mode, how to set remote listening port (data stream)
I try to connect with an FTP server with apache-commons-net-3.7.2 (implicit TLS, double factor authentication with client cert + login/password). I can authenticate myself, enter in passive mode, but the client doesn’t succeed in connecting to the server in order to get data by the data socket. I can connect myself, on the same computer, with WinSCP (same settings). I
Can you access files on the remote FTP server with RandomAccessFile?
I’m trying to read the file on the FTP remote-server using Apache Commons Net library. retrieveFileStream returns InputStream and put it in BufferedReader. But, I want to use RandomAccessFile (to use the seek() method). I want to get Inputstream as a RandomAccessFile. Is it possible? Answer If you want to starting reading the remote file from a certain offset, use
Does Apache Commons Net FTPClient use passive or active mode by default?
The app I’m working with uses FTPClient class from Apache Commons Net to connect and transfer files to a FTP server. I’m trying to establish if it’s doing that in a passive or active mode by default and I can’t see any references in the app’s code or in the library itself. Any ideas? Answer The active mode is the
Error “227 Entering Passive Mode”/”Connection refused” when downloading from local FTP server in Android emulator
I am trying to download a file from my local FileZilla Server with Java FTPSClient running in Android emulator. I’ve written this helpercode to download one File: I call this function like this: But I keep getting this error: I already tried to use enterLocalActivemode() instead of enterLocalPassivmode() but it didn’t help. The FTP server is TLS enforcing and running
Apache Java FTP client does not switch to binary transfer mode on some servers
I’m using org.apache.commons.net.ftp library to work with FTP servers. I use about 5 FTP servers and one of them doesn’t work properly (for me). For uploading files I also use method ftpClient.setFileType(FTP.BINARY_FILE_TYPE), but on this server the size of the uploaded file is not the same as on my local HDD. It is usually MP3 files and when I try
Make FTP server return files listed by timestamp with Apache FTPClient
I have written this below code to connect to a remote FTP Server (vsftp in CentOS 6). (For brevity Exception handling is not shown here) If there are 100 files in that FTP server, this listFiles() gives the list of file names according to the Alphabetical order. Is there any way to get the files according to the modified time?
FTPClient.listFiles is not returning time in seconds
I have written the above function to retrieve the file details. But somehow I am retrieving the details without seconds part of the file. I am retrieving the lastModifiedDate as 2013-08-08 00:00:00 where as its actual lastModifiedDate is 2013-08-08 12:53:27 PM Answer The FTPClient.listFiles uses the ancient LIST command. With the command, it’s quite common that the FTP server returns
How to get info of an FTPFile
I am using ApacheCommons to connect to a server and get information of a specific file. I am looking for a method like FTPFile file = ftpclient.getFile(path); or something like this, so I can give it the path of the file and then be able to get info about that file. By info I mean file.getName() or file.lendth(). The only