Org.apache.commons.net.io.copystreamexception: ioexception пойман во время копированияJAVA

Программисты JAVA общаются здесь
Anonymous
Org.apache.commons.net.io.copystreamexception: ioexception пойман во время копирования

Сообщение Anonymous »

Я пытаюсь скопировать некоторые файлы, созданные на моем сервере для FTP, используя код в методе ниже. Но странно, что я получаю ошибку ниже ошибки, и я не мог понять, что происходит. < /P>

Exception =org.apache.commons.net.io.CopyStreamException: IOException caught while copying.
< /code>

Ниже приведен код, с помощью которого я копирую файлы в FTP. < /p>

public void copyDumpsToFTP() throws SocketException, IOException
{

FTPClient f= new FTPClient();
f.connect(dumpProperties.getProperty("ftpIPAddress"));
boolean flag =f.login(dumpProperties.getProperty("ftpUser"),dumpProperties.getProperty("ftpPassword"));
System.out.println(" is connected to FTP ::"+flag);

// setting fileType to binary

boolean isFileTypeChanged =f.setFileType(FTP.BINARY_FILE_TYPE);

// System.out.println(" Is file type changed to binary :: "+isFileTypeChanged);
// change working directory of FTP Server

boolean isDirectoryChanged =f.changeWorkingDirectory(dumpProperties.getProperty("ftpDirectory"));

System.out.println(" Is the FTP working directory Changed :: "+isDirectoryChanged);

// to copy engineering dump from source to FTP

InputStream inputFileEngg = new FileInputStream(new File(dumpNameEngineering));

boolean isSavedEngg = f.storeFile(dumpProperties.getProperty("dumpNameOfEnggInFTP"), inputFileEngg);
System.out.println("is Engineering dump File Saved in FTP Server :: "+isSavedEngg);
System.out.println(" Engg Dump sucessfully Created and Saved in FTP...");

// to copy correspondance dump from source to FTP

InputStream inputFileCorr = new FileInputStream(new File(dumpNameCorrespondance));

boolean isSavedCorr = f.storeFile(dumpProperties.getProperty("dumpNameOfCorrInFTP"), inputFileCorr);
System.out.println("is Correspondance File Saved in FTP Server :: "+isSavedCorr);
System.out.println(" Correspondance Dump sucessfully Created and Saved in FTP...");

// to copy tmg dump from source to FTP

InputStream inputFileTmg = new FileInputStream(new File(dumpNameTmg));

boolean isSavedTmg = f.storeFile(dumpProperties.getProperty("dumpNameOfTmgInFTP"), inputFileTmg);
System.out.println("is TMG File Saved in FTP Server :: "+isSavedTmg);
System.out.println(" TMG Dump sucessfully Created and Saved in FTP...");

}
< /code>

Программа выполняется до тех пор, пока оператор SOP не является рабочим каталогом FTP, измененным :: true < /code> < /p>

И последнее, что он получил ошибку, как указано выше. < /p>

Подробнее здесь: https://stackoverflow.com/questions/937 ... le-copying

Вернуться в «JAVA»