资源简介
代码片段和文件信息
/*
* Copyright (c) 1996-2010 Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS
* IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL
* EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE DATA OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
*
* @author Christopher Cotton
*/
import javax.mail.*;
/**
* copier will copy a specified number of messages from one folder
* to another folder. it demonstrates how to use the JavaMail APIs
* to copy messages.
*
* Usage for copier: copier store urlname
* src folder dest folder start msg # end msg #
*
*/
public class copier {
public static void main(String argv[]) {
boolean debug = false; // change to get more errors
if (argv.length != 5) {
System.out.println( “usage: copier “ +
“ “);
return;
}
try {
URLName url = new URLName(argv[0]);
String src = argv[1]; // source folder
String dest = argv[2]; // dest folder
int start = Integer.parseInt(argv[3]); // copy from message #
int end = Integer.parseInt(argv[4]); // to message #
// Get the default Session object
Session session = Session.getInstance(System.getProperties() null);
// session.setDebug(debug);
// Get a Store object that implements the protocol.
Store store = session.getStore(url);
store.connect();
System.out.println(“Connected...“);
// Open Source Folder
Folder folder = store.getFolder(src);
folder.open(Folder.READ_WRITE);
System.out.println(“Opened source...“);
if (folder.getMessageC
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-03-20 15:29 javamail-1.4.5\
文件 3322 2012-03-20 15:29 javamail-1.4.5\COPYRIGHT.txt
文件 28014 2012-03-20 15:29 javamail-1.4.5\CHANGES.txt
文件 8469 2012-03-20 15:29 javamail-1.4.5\README.txt
文件 1200 2012-03-20 15:29 javamail-1.4.5\NTLMNOTES.txt
文件 16181 2012-03-20 15:29 javamail-1.4.5\LICENSE.txt
文件 9142 2012-03-20 15:29 javamail-1.4.5\NOTES.txt
文件 11663 2012-03-20 15:29 javamail-1.4.5\SSLNOTES.txt
文件 1726 2012-03-20 15:29 javamail-1.4.5\distributionREADME.txt
文件 5899 2012-03-20 15:29 javamail-1.4.5\COMPAT.txt
目录 0 2011-03-05 10:32 javamail-1.4.5\docs\
文件 41785 2011-03-05 10:32 javamail-1.4.5\docs\JavaMail-1.2-changes.txt
文件 38322 2011-03-05 10:32 javamail-1.4.5\docs\JavaMail-1.4-changes.txt
文件 12193 2011-03-05 10:32 javamail-1.4.5\docs\JavaMail-1.3-changes.txt
文件 23606 2011-03-05 10:32 javamail-1.4.5\docs\JavaMail-1.1-changes.txt
目录 0 2012-03-20 15:25 javamail-1.4.5\docs\javadocs\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\resources\
目录 0 2012-03-20 12:32 javamail-1.4.5\docs\javadocs\com\
目录 0 2012-03-20 12:32 javamail-1.4.5\docs\javadocs\com\sun\
目录 0 2012-03-20 12:32 javamail-1.4.5\docs\javadocs\com\sun\mail\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\smtp\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\smtp\class-use\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\imap\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\imap\class-use\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\util\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\util\class-use\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\util\logging\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\util\logging\class-use\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\dsn\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\dsn\class-use\
目录 0 2012-03-20 12:33 javamail-1.4.5\docs\javadocs\com\sun\mail\pop3\
............此处省略456个文件信息
相关资源
- spring2.5+JDK1.8 版本报错的解决办法(修
- jan.jar和examples.jar
- 驱动包 db2jcc.jar
- IKAnalyzer2012_u6中文分词器jar包
- struts2-dojo-plugin-2.2.3.jar
- jfreechart-1.0.19.jar+jcommon-1.0.23.jar
- fastjson-1.2.38的jar包
- swing皮肤 beautyeye_lnf.jar
- jackson的jar包
- MVC设计模式的JavaWeb项目所需要的jar
-
JSONob
ject所需的6个依赖jar包 - Spring-Aop所有jar
- 最新 lombok 1.18.4.jar
- java发送邮件jar包
- core-2.3.0 + QRCode + zxing-1.6-core + zxing-j
- servlet库,commons-logging.jar,commons-bea
- smack-jar包
- jackson2.6 最新jar包
- antlr-v4jar包和使用教程
- Spring AOP的AspectJ支持jar包
- itextpdf.jar
- CCP_REST_SMS_SDK_JAVA_v2.6.3r.jar
- glide-3.7.0.jar
- Jmeter需要的JDBC测试jar包
- com.lowagie.text-2.1.7.rar
- Java解析apk所需jar包
- bcprov-jdk16-146.jar
- itextpdf-5.1.2.jar
- dubbo 2.8.4 jar
- lucene-core-3.6.1.jar
评论
共有 条评论