posted 14 years ago
Having an issue and cannot seem to find the resolution. I was unable to find a method for copying a directory recursively to another ftp server or to another folder on the same server.
I have thrown together the following code to do so and it works fine if you create only the directories and not transfer any files.
If you transfer files the InputStream becomes NULL after the first file transfers and kills the program. I have had it check to make sure the FTP connection is still love and even know it is I always result in the same issue.
You can see from the following Output that the Stream always transfers one file successfully.
Under the output is the code I am using.
Any help would be appreciated or a better method, but it has to be able to be done using only Jakarta Libraries and java.io
06-26 21:53:25.049: INFO/System.out(1152): Creating Directoy>>>>test/
06-26 21:53:25.139: INFO/System.out(1152): Directory Created>>>>test/
06-26 21:53:25.619: INFO/System.out(1152): Sending Src and Dst>>>>test/.>>>>>>>test/.
06-26 21:53:25.619: INFO/System.out(1152): Omitting>>>test/. <<<
06-26 21:53:25.619: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/.>>>>>>>test/.
06-26 21:53:25.619: INFO/System.out(1152): Sending Src and Dst>>>>test/..>>>>>>>test/..
06-26 21:53:25.619: INFO/System.out(1152): Omitting>>>test/.. <<<
06-26 21:53:25.619: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/..>>>>>>>test/..
06-26 21:53:25.619: INFO/System.out(1152): Sending Src and Dst>>>>test/ArtistSetList.php>>>>>>>test/ArtistSetList.php
06-26 21:53:25.619: INFO/System.out(1152): Begin Input Output>>>>test/ArtistSetList.php>>>>>>>test/ArtistSetList.php
06-26 21:53:26.339: INFO/System.out(1152): Completed Input Output>>>>test/ArtistSetList.php>>>>>>>test/ArtistSetList.php
06-26 21:53:26.339: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/ArtistSetList.php>>>>>>>test/ArtistSetList.php
06-26 21:53:26.339: INFO/System.out(1152): Sending Src and Dst>>>>test/BandSelection.php>>>>>>>test/BandSelection.php
06-26 21:53:26.339: INFO/System.out(1152): Begin Input Output>>>>test/BandSelection.php>>>>>>>test/BandSelection.php
06-26 21:53:26.439: INFO/System.out(1152): InputStream is Null
06-26 21:53:26.439: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/BandSelection.php>>>>>>>test/BandSelection.php
06-26 21:53:26.439: INFO/System.out(1152): Sending Src and Dst>>>>test/Copy of check2.php>>>>>>>test/Copy of check2.php
06-26 21:53:26.439: INFO/System.out(1152): Begin Input Output>>>>test/Copy of check2.php>>>>>>>test/Copy of check2.php
06-26 21:53:26.624: INFO/System.out(1152): InputStream is Null
06-26 21:53:26.624: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/Copy of check2.php>>>>>>>test/Copy of check2.php
06-26 21:53:26.624: INFO/System.out(1152): Sending Src and Dst>>>>test/check.php>>>>>>>test/check.php
06-26 21:53:26.624: INFO/System.out(1152): Begin Input Output>>>>test/check.php>>>>>>>test/check.php
06-26 21:53:26.750: INFO/System.out(1152): InputStream is Null
06-26 21:53:26.750: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/check.php>>>>>>>test/check.php
06-26 21:53:26.750: INFO/System.out(1152): Sending Src and Dst>>>>test/check2.php>>>>>>>test/check2.php
06-26 21:53:26.750: INFO/System.out(1152): Begin Input Output>>>>test/check2.php>>>>>>>test/check2.php
06-26 21:53:26.930: INFO/System.out(1152): InputStream is Null
06-26 21:53:26.930: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/check2.php>>>>>>>test/check2.php
06-26 21:53:26.930: INFO/System.out(1152): Sending Src and Dst>>>>test/crawler.php>>>>>>>test/crawler.php
06-26 21:53:26.930: INFO/System.out(1152): Begin Input Output>>>>test/crawler.php>>>>>>>test/crawler.php
06-26 21:53:27.069: INFO/System.out(1152): InputStream is Null
06-26 21:53:27.069: INFO/System.out(1152): Finished Sending Src and Dst>>>>test/crawler.php>>>>>>>test/crawler.php