FileUtils.copyDirectory因远程文件大于7megas而失败

时间:2019-07-05 18:59:37

标签: java groovy apache-commons-io

FileUtils.copyDirectory因远程文件大于7兆而失败

进口:

import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;

代码:

String source = fm_dirIn;
File srcDir = new File(source);

// The destination directory to copy to. This directory
// doesn't exists and will be created during the copy
// directory process.
String destination = fm_dirOut;
File destDir = new File(destination);

try {
    // Copy source directory into destination directory
    // including its child directories and files. When
    // the destination directory is not exists it will
    // be created. This copy process also preserve the
    // date information of the file.
    FileUtils.copyDirectory(srcDir, destDir);
    return true
} catch (IOException e) {
    'Erreur : ' + e.printStackTrace();
}

结果

  

Erreur:null,并且复制的列表文件在此文件上停止为7040kb(31944 KB)

printStackTrace:

  

当前堆栈跟踪为:java.io.IOException:Erreurréseauinattendue           在sun.nio.ch.FileDispatcherImpl.pwrite0(本机方法)           在sun.nio.ch.FileDispatcherImpl.pwrite(未知来源)           在sun.nio.ch.IOUtil.writeFromNativeBuffer(未知来源)           在sun.nio.ch.IOUtil.write(未知来源)           在sun.nio.ch.FileChannelImpl.writeInternal(未知来源)           在sun.nio.ch.FileChannelImpl.write(未知源)           在sun.nio.ch.FileChannelImpl.transferFromFileChannel(未知来源)           在sun.nio.ch.FileChannelImpl.transferFrom(未知来源)           在org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1131)       在org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1424)           在org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1366)           在org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1246)           在org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1215)           在org.apache.commons.io.FileUtils $ copyDirectory.call中(未知来源)           在org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)           在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)           在org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)           在Script1.run(Script1.groovy:27)           在groovy.lang.GroovyShell.evaluate(GroovyShell.java:518)           在groovy.lang.GroovyShell.evaluate(GroovyShell.java:556)           在groovy.lang.GroovyShell.evaluate(GroovyShell.java:527)           在com.prosc.beanshell.BeanShellModel.evaluateGroovy(BeanShellModel.java:163)           在com.prosc.beanshell.BeanShellPlugin.EvaluateGroovy(BeanShellPlugin.java:603)           在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处           在sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)           在sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)           在java.lang.reflect.Method.invoke(未知来源)           在com.prosc.fmkit.StaticFunction.invoke(StaticFunction.java:231)           在com.prosc.fmkit.Plugin.invokeFunction(Plugin.java:339)           在com.prosc.fmkit.RegisterablePlugin.invokeFunction(RegisterablePlugin.java:146)           在com.prosc.fmkit.Plugin.invokeFunctionNoErrors(Plugin.java:320)           在com.prosc.fmkit.PluginBridge $ 3.run(PluginBridge.java:1132)           在com.prosc.fmkit.PluginBridge $ 5.run(PluginBridge.java:1234)           在java.awt.event.InvocationEvent.dispatch(未知来源)           在java.awt.EventQueue.dispatchEventImpl(未知来源)           在java.awt.EventQueue.access $ 500(未知源)           在java.awt.EventQueue $ 3.run(未知源)           在java.awt.EventQueue $ 3.run(未知源)           在java.security.AccessController.doPrivileged(本机方法)           在java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(未知   资源)           在java.awt.EventQueue.dispatchEvent(未知来源)           在java.awt.EventDispatchThread.pumpOneEventForFilters(未知来源)           在java.awt.EventDispatchThread.pumpEventsForFilter(未知来源)           在java.awt.EventDispatchThread.pumpEventsForHierarchy(未知来源)           在java.awt.EventDispatchThread.pumpEvents(未知来源)           在java.awt.EventDispatchThread.pumpEvents(未知来源)           在java.awt.EventDispatchThread.run(未知来源)

0 个答案:

没有答案