| | |
| | | for (String s : typeArray) { |
| | | s.trim(); |
| | | if (!checkDirectory(ftp, s)) { |
| | | ftp.mkdir(s); |
| | | if(!ftp.existsDirectory(s)) { |
| | | ftp.mkdir(s); |
| | | } |
| | | changeDirectory(s); |
| | | } |
| | | } |
| | | } |
| | | ftp.put(inStream, fileName); |
| | | changeDirectory("/"); |
| | | } |
| | | |
| | | public void uploadFile2(File inFile,String fileName) throws IOException, FTPException { |
| | | InputStream inStream = new FileInputStream(inFile); |
| | | ftp.put(inStream, fileName); |
| | | } |
| | | |
| | | /** |
| | |
| | | public String[] getDirList() throws IOException, FTPException { |
| | | return ftp.dir(); |
| | | } |
| | | |
| | | public void mkdir(String dirPath) throws IOException, FTPException { |
| | | ftp.mkdir(dirPath); |
| | | } |
| | | } |