资源简介
代码片段和文件信息
/*
* 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 28014 2012-03-20 15:29 java 发邮件用的api和jar包\CHANGES.txt
文件 5899 2012-03-20 15:29 java 发邮件用的api和jar包\COMPAT.txt
文件 3322 2012-03-20 15:29 java 发邮件用的api和jar包\COPYRIGHT.txt
文件 2586 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\Componentfr
文件 4217 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\FolderModel.java
文件 3732 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\FolderTreeNode.java
文件 3245 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\FolderViewer.java
文件 6926 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\MessageViewer.java
文件 5255 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\MultipartViewer.java
文件 4069 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\README.txt
文件 196 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\simple.mailcap
文件 4673 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\SimpleAuthenticator.java
文件 5344 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\SimpleClient.java
文件 3815 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\StoreTreeNode.java
文件 3232 2011-03-05 10:32 java 发邮件用的api和jar包\demo\client\TextViewer.java
文件 3760 2011-03-05 10:32 java 发邮件用的api和jar包\demo\copier.java
文件 3004 2011-03-05 10:32 java 发邮件用的api和jar包\demo\CRLFOutputStream.java
文件 5812 2011-03-05 10:32 java 发邮件用的api和jar包\demo\folderlist.java
文件 9156 2012-01-17 15:19 java 发邮件用的api和jar包\demo\logging\FileErrorManager.java
文件 1415 2011-03-05 10:32 java 发邮件用的api和jar包\demo\logging\maildemo.properties
文件 15541 2012-01-17 15:19 java 发邮件用的api和jar包\demo\logging\MailHandlerDemo.java
文件 1942 2011-03-05 10:32 java 发邮件用的api和jar包\demo\logging\README.txt
文件 3369 2011-03-05 10:32 java 发邮件用的api和jar包\demo\logging\SummaryFormatter.java
文件 4343 2011-03-05 10:32 java 发邮件用的api和jar包\demo\logging\SummaryNameFormatter.java
文件 4075 2011-03-05 10:32 java 发邮件用的api和jar包\demo\monitor.java
文件 5693 2011-03-05 10:32 java 发邮件用的api和jar包\demo\mover.java
文件 3996 2011-03-05 10:32 java 发邮件用的api和jar包\demo\msgmultisendsample.java
文件 7338 2011-03-05 10:32 java 发邮件用的api和jar包\demo\msgsend.java
文件 4629 2011-03-05 10:32 java 发邮件用的api和jar包\demo\msgsendsample.java
文件 12609 2012-02-03 16:42 java 发邮件用的api和jar包\demo\msgshow.java
............此处省略460个文件信息
- 上一篇:Android Studio从入门到精通_清晰版
- 下一篇:Android透明指示层
相关资源
- json-lib所需全部jar包json-lib-2.2.3-jdk13
- java连接db2jar包
- 用java写socket.io客户端所需jar包
- 解析apk所需jar包
- JAVA_EE_api_中英文对照版.chm(田克传制
- ojdbc7-12.1.0.1.jar(适用于jdk1.7和1.8)
- quartz-2.1.7 官方jar包源码
- zkui 构建成功后的jar包
- Java摄像开源框架文档、案例、Jar包、
- 支付宝相关jar包
- icepdf-5.0.6_jar包
- jxls2.4.2 依赖jar包
- 致远A8-M平台API参考手册
- OpenOffice转格式开发所需所有Jar包含
- java创建excel文件所需的jar包(jxl.jar
- jar包混淆工具ProGuard 5.3
- Flying-Saucer jar包
- jsf2.0 完整(含所有jar包)
- jfreechar最新jar包
- struts1jar包
- andengine 最新 各个jar包10个包
- java类查找工具jclassfinder
- mysql dbcp jar包
-
xm
lbeans的jar包 - json解析需要的jar包
- commons-dbcp2 jar包
- greendao-3.2.2 jar包最新
- 配置Druid连接池需要的jar包-druid-1.0.
- 最新JFreeChartjar包链接
- springMVC所需的所有jar包全
评论
共有 条评论