为什么邮件被转移走后renameTo()不能改名后转移回来
来源:百度知道 编辑:UC知道 时间:2024/08/21 03:49:56
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
public class MoveEML {
public static void main(String[] args) {
// TODO Auto-generated method stub
Subject sj=new Subject();
ReadSender rs=new ReadSender();
Passage ps=new Passage();
ReadFj fj=new ReadFj();
int j = 0;
while(true) {
File f = new File("c:/Mailboxes/out/");
File[] fArray = f.listFiles();
//System.out.println(fArray.length);
for(int i=0; i<fArray.length; i++) {
if(fArray[i].getName().matches("[\\w\\s.]*.eml$")) {
System.out.println("新邮件"+fArray[i].getName()+"被转移");
try {
FileInputStream is = new FileInputStream(fArray[i]);
byte[] b = new byte[(int)fArray[i].length()];<
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
public class MoveEML {
public static void main(String[] args) {
// TODO Auto-generated method stub
Subject sj = new Subject();
ReadSender rs = new ReadSender();
Passage ps = new Passage();
ReadFj fj = new ReadFj();
while (true) {
File f = new File("c:/Mailboxes/out/");
File[] fArray = f.listFiles();
// System.out.println(fArray.length);
for (int i = 0; i < fArray.length; i++) {
if (fArray[i].getName().matches("[\\w\\s.]*.eml$")) {
System.out.println("新邮件" + fArray[i].getName() + "被转移");
try {
FileInputStream is = new FileInputStream(fArray[i]);
byte[] b = new byte[(int) fArray[i].len