如何在java中一个接一个地从文件夹中移动文件 [英] how to move files from a folder one after another in java

查看:276
本文介绍了如何在java中一个接一个地从文件夹中移动文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解决这个问题,我必须一次将文件从一个文件夹移动到另一个文件夹。我有3个文件夹管道,进程,已完成,在管道中有很多pdfs现在需要将一个pdf从管道移动到进程。如果我将pdf从流程移动到完成,则另一个pdf必须从管道移动到流程。

所有这一切都应该以一个pdf一次一个地移动到另一个文件夹的方式完成。

我可以一次性移动所有文件。但现在我应该一次做一个



请指导我解决这个问题

i need to solve this problem where i have to move files from one folder to another one at a time. i've 3 folders pipe,process,completed, in pipe there are lots of pdfs now in need to move one pdf from pipe to process. if i move the pdf from process to completed, another pdf must move from pipe to process.
all this should be done in such a way that one pdf is moved to another folder one at a time.
i am able to move all files in one go. but now i should do it one at a time

please guide me to solve this problem

推荐答案

你还没有给出足够的细节来猜测你不能做哪些部分,所以我建议你看看 https://docs.oracle.com/javase/tutorial/essential/io/dirs.html [ ^ ]用于获取文件列表。然后,您只需要在三个进程之间一次传递一个。
You have not really given enough detail to guess which parts you cannot do, so I suggest taking a look at https://docs.oracle.com/javase/tutorial/essential/io/dirs.html[^] for getting a list of files. You then just need to pass them between your three processes one at a time.


这篇关于如何在java中一个接一个地从文件夹中移动文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆