JAVA²Ù×÷ZIPÎļþ
ÎÄÕÂת×Ô£ºhttp://www.abcjava.com/html/JAVA/JAVAjichu/2009/1018/1080.html
ÔÚÍøÂç´«Êä¶à¸öÎļþµÄʱºò£¬Èç¹ûÒ»¸öÒ»¸ö´«ÍùÍù»á·Ç³£ºÄʱ£¬¶øÇÒÒ²»áÏûºÄµô¸ü¶àµÄ¼ÆËã»úϵͳ×ÊÔ´¡£Èç¹ûÎÒÃǽ«¶à¸öÎļþ´ò°üºóÔÙ´«Ê佫»á½ÚÔ¼ºÜ¶àµÄ¼ÆËã»ú×ÊÔ´£¬ÕâÀÎÒ½«Îª´ó¼ÒչʾÈçºÎ¶ÁÈ¡¡¢½âѹºÍ´´½¨ZIPÎļþ£¬µ±È»£¬ÕâÀïÖ»ÊǼòµ¥½éÉÜ£¬¹ØÓÚzipÎļþÓкܶàϸ½ÚÐèÒª´ó¼Ò×Ô¼ºÈ¥ÊµÏÖ¡£¹ØÓÚjava¶ÔzipµÄ²Ù×÷£¬Ö÷ÒªÊÇÓõÄjava.util.zip°üÖеÄÀà¡£
Ò»¡¢¶ÁÈ¡ZIPÎļþ
ZipFileÀàÓÃÓÚ´Ó ZIP Îļþ¶ÁÈ¡ÌõÄ¿¡£ËùÒÔ£¬Ê×ÏÈÐèÒª´´½¨Ò»¸öZipFile¶ÔÏó£¬È»ºóʹÓÃZipFile¶ÔÏóµÄentries()·½·¨»ñÈ¡ZipÎļþÖеÄËùÓÐÌõÄ¿£¬¾ßÌå´úÂëÈçÏ£º
public static void readZipFile(File file) { try { ZipFile zipfile = new ZipFile(file); //´´½¨ZipFile¶ÔÏó System.out.println(zipfile.getName()); //´òÓ¡ZipÎļþ·¾¶ System.out.println("ZIPÌõÄ¿Êý£º" + zipfile.size()); //´òÓ¡ZipÎļþÌõÄ¿Êý Enumeration<? extends ZipEntry> en = zipfile.entries(); ZipEntry entry; while(en.hasMoreElements()) { entry = en.nextElement(); System.out.println(entry.getName()); } zipfile.close(); }catch(ZipException e) { System.out.println(file.getName() + "ѹËõÎļþ´íÎó"); }catch(IOException e) {
Ïà¹ØÎĵµ£º
×î½üÓöµ½Ò»¸öÐèÇóÒªÔÚlinuxÏÂÓÃjava µ÷ÓÃmysql¿Í»§¶ËÔ¶³ÌµÇ½mysql·þÎñÆ÷£¬´Ó¿Í»§¶Ë»úÆ÷µ¼Èëmysql½Å±¾£¬´Ómysql·þÎñÆ÷¶Ëµ¼³ö±íÖеÄÊý¾Ý¡£ÒÔÏÂÊÇÓõ½µÄÖ÷Òª·½·¨£º
Java ´úÂë
/**
* µ¼ÈëÊý¾Ý
* @param ½Å±¾µÄµØÖ·ºÍÃû³Æ
* @return ÊÇ·ñ³ ......
tomcatÆô¶¯web·þÎñµÄʱºò×ÜÊÇ»áÓÐ8СʱµÄʱ²î,
×ÁÄ¥Á˺þÃ,×î¼òµ¥µÄ°ì·¨¾ÍÊÇ
ÕÒµ½Îļþ¼Ðjdk1.6.0_07\jre\lib\zi\Etc
ÕâÀï±ß¶¼ÊÇÒ»Ð©Ê±ÇøÎļþGTM+1,GTM+2,GTM+3....
±¸·ÝÒ»·ÝEtc
¿½±´N·ÝGTM+8Îļþ(ÖйúµÄÊ±ÇøÊÇGTM+8)
°ÑGMT+8ÎļþÃû¸Ä³ÉGTM+1,GTM+2,GTM+3....
¸²¸ÇµôÔÀ´µÄEtcÀï±ßµÄÎļþ
ÖØÆôtomcatÎÊÌâ½â¾ö ......
import java.awt.*;
import javax.swing.*;
import java.util.Date;
import java.awt.*;
class Time extends JFrame implements Runnable{//ʵÏÖ½Ó¿Ú
Thread clockThread;
JLabel jLabel=new JLabel();
public Time()
{
Container con=this.getContentPane() ......
ʱ¼ä¶¯Ì¬ÏÔʾ
1.·½·¨Ò» ÓÃTimerTask
ÀûÓÃjava.util.TimerºÍjava.util.TimerTaskÀ´×ö¶¯Ì¬¸üУ¬±Ï¾¹Ã¿´Î¸üпÉÒÔ¿´×÷ÊǼÆÊ±1Ãë·¢ÉúÒ»´Î¡£
´úÂëÈçÏ£º
import java.awt.Dimension;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util ......
1.Listת»»³ÉΪÊý×é¡££¨ÕâÀïµÄListÊÇʵÌåÊÇArrayList)
µ÷ÓÃArrayListµÄtoArray·½·¨¡£
Àý£ºString[] arr = (String[])list.toArray(new String[size]);
2.Êý×éת»»³ÉΪList¡£
µ÷ÓÃArraysµÄasList·½·¨¡£
Àý£ºList stooges = Arrays.asList("Larry", "Moe", "Curly"); ......