org.apache.commons.net.io.CopyStreamException:复制时捕获到IOException [英] org.apache.commons.net.io.CopyStreamException: IOException caught while copying
本文介绍了org.apache.commons.net.io.CopyStreamException:复制时捕获到IOException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用以下方法中的代码将我服务器中创建的一些文件复制到FTP。但奇怪的是我随机得到以下错误,我无法弄清楚发生了什么。
I'm trying to copy some files created in my server to FTP using code in below method. But weird thing is i'm getting below error randomly and i couldn't figure out what is happening.
Exception =org.apache.commons.net.io.CopyStreamException: IOException caught while copying.
以下是我将文件复制到FTP的代码。
Below is the code by which i'm copying the files to FTP.
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...");
}
该程序正在执行,直到SOP语句 FTP工作目录是否已更改:: true
The program is executing till SOP statement Is the FTP working directory Changed :: true
后来它抛出了错误如上所述。
and latter it had thrown error as mentioned above.
推荐答案
当磁盘空间不可用或磁盘引用超出时发生此错误。
This error occurred when disk space is not available or disk quote exceed.
这篇关于org.apache.commons.net.io.CopyStreamException:复制时捕获到IOException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文