JavaѹËõÀà¿âµÄʹÓà 3.Apache AntÖеĴò°ü¡¢Ñ¹ËõÀà¿â
¡¡¡¡inkfishÔ´´£¬ÇëÎðÉÌÒµÐÔÖÊתÔØ£¬×ªÔØÇë×¢Ã÷À´Ô´£¨http://blog.csdn.net/inkfish£©¡£
¡¡¡¡ÕâÀïÐèÒª¹Ø×¢µÄÊÇBZIP2¸ñʽ£¬¾¹ý²âÊÔ£¬×ÜÊÇÎÞ·¨ÕýȷѹËõ£¬ÔÒòδ֪£¬¶øapache commons bzip2¸ñʽµÄÎļþѹËõÕý³£¡££¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
Ant ZIPѹËõ£º£¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
package study.inkfish.compress;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import org.apache.commons.io.IOUtils;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
import org.apache.tools.zip.ZipOutputStream;
public class AntZipCompress extends Compress {
@Override
protected void doCompress(File srcFile, File destFile) throws IOException {
ZipOutputStream zout = null;
InputStream is = null;
try {
is = new BufferedInputStream(new FileInputStream(srcFile), bufferLen);
zout = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(destFile), bufferLen));
zout.putNextEntry(new ZipEntry(srcFile.getName()));
IOUtils.copy(is, zout);
zout.closeEntry();
} finally {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(zout);
}
}
@Override
protected void doDecompress(File srcFile, File destDir) throws IOException {
ZipFile zipFile = new ZipFile(srcFile);
try {
@SuppressWarnings("unchecked")
Enumeration<ZipEntry> enums = zipFile.getEntries();
while (enums.hasMoreElements()) {
ZipEntry entry = enums.nextElement();
InputStream is = new BufferedInputStream(zipFile.getInputStream(entry), bufferLen);
OutputStream os = null;
try {
os = new BufferedOutputStream(new FileOutputStream(new File(destDir, entry.getName())), bufferLen);
IOUtils.copy(is, os);
} finally {
IOUtils.closeQuietly(is);
IOUtils.clo
Ïà¹ØÎĵµ£º
ÔÚÄãµÄ´úÂëÀïµ÷ÓÃÁËһЩ×ÊÔ´Îļþ£¬ÈçͼƬ£¬ÒôÀֵȣ¬ÔÚµ÷ÊÔ»·¾³»òµ¥¶ÀÔËÐеÄʱºò¿ÉÒÔÕý³£ÏÔʾ»ò²¥·Å£¬¶øÒ»µ©´ò°üµ½jarÎļþÖУ¬ÕâЩ¶«¶«¾ÍÔÙÒ²³ö²»À´ÁË£¬³ý·Ç°ÑÕâ¸öjar·Åµ½ÔÀ´Î´´ò°üÒÔÇ°µÄĿ¼Ï£¬µ«Í¨³£jarÊǵ¥¶À·¢²¼µÄ¡£
[¹Ø¼ü×Ö] java jarÎļþ°ü ×ÊÔ´
¡¡¡¡¿ÉÄÜÓв»ÉÙ³õѧÕß»áÓÐÕâÑùµÄÀ§»ó£ºÔÚÄãµÄ´úÂëÀïµ÷ÓÃÁË ......
ʹÓÃJAVA¿ª·¢ÏµÍ³ÍÐÅ̳ÌÐò
@for&ever 2009-11-27
²Î¿¼ÎÄÕ¡¶New System Tray Functionality in Java SE 6¡·£¬ÍøÖ· http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/ ¡£
JDK±ØÐëÒªÔÚ 1.6 °æ±¾¡£
×î½üÏîÄ¿ÖÐҪʵÏÖ¶¨Ê±ÈÎÎñ³£×¤ÏµÍ³£¬Äܹ»Í¬Ê±ÓÐÒ»¸ö±È½ÏÓѺõIJÙ×÷·½Ê½Ìṩ¸ø ......
SCJP5ѧϰ±Ê¼Ç
Ò»¡¢²Ù×÷ϵͳÖÐÏ̺߳ͽø³ÌµÄ¸ÅÄî
ÏÖÔڵIJÙ×÷ϵͳÊǶàÈÎÎñ²Ù×÷ϵͳ¡£¶àÏß³ÌÊÇʵÏÖ¶àÈÎÎñµÄÒ»ÖÖ·½Ê½¡£
½ø³ÌÊÇÖ¸Ò»¸öÄÚ´æÖÐÔËÐеÄÓ¦ÓóÌÐò£¬Ã¿¸ö½ø³Ì¶¼ÓÐ×Ô¼º¶ÀÁ¢µÄÒ»¿éÄÚ´æ¿Õ¼ä£¬Ò»¸ö½ø³ÌÖпÉÒÔÆô¶¯¶à¸öÏ̡߳£±ÈÈçÔÚWindowsϵͳÖУ¬Ò»¸öÔËÐеÄexe¾ÍÊÇÒ»¸ö½ø³Ì¡£
Ïß³ÌÊÇÖ¸½ø³ÌÖеÄÒ ......