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
Ïà¹ØÎĵµ£º
ÈçºÎ¶ÁÈ¡×ÊÔ´Îļþ£º
£¨Ò»£©
Properties props = new Properties();
props.load(new FileInputStream("db.properties"));
£¨¶þ£©
blog.propertiesÎļþÈçÏÂ
dbdriver=oracle.jdbc.driver.OracleDriver
dburl=jdbc:oracle:thin:@127.0.0.1:1521:ora92
dbuser=blog
dbpwd=blog
- ......
SCJP5ѧϰ±Ê¼Ç
Ò»¡¢²Ù×÷ϵͳÖÐÏ̺߳ͽø³ÌµÄ¸ÅÄî
ÏÖÔڵIJÙ×÷ϵͳÊǶàÈÎÎñ²Ù×÷ϵͳ¡£¶àÏß³ÌÊÇʵÏÖ¶àÈÎÎñµÄÒ»ÖÖ·½Ê½¡£
½ø³ÌÊÇÖ¸Ò»¸öÄÚ´æÖÐÔËÐеÄÓ¦ÓóÌÐò£¬Ã¿¸ö½ø³Ì¶¼ÓÐ×Ô¼º¶ÀÁ¢µÄÒ»¿éÄÚ´æ¿Õ¼ä£¬Ò»¸ö½ø³ÌÖпÉÒÔÆô¶¯¶à¸öÏ̡߳£±ÈÈçÔÚWindowsϵͳÖУ¬Ò»¸öÔËÐеÄexe¾ÍÊÇÒ»¸ö½ø³Ì¡£
Ïß³ÌÊÇÖ¸½ø³ÌÖеÄÒ ......
SCJP5ѧϰ±Ê¼Ç
Ò»¡¢¶¨ÒåÏß³Ì
1¡¢À©Õ¹java.lang.ThreadÀà¡£
´ËÀàÖÐÓиörun()·½·¨£¬Ó¦¸Ã×¢ÒâÆäÓ÷¨£º
public void run
()
Èç¹û¸ÃÏß³ÌÊÇʹÓöÀÁ¢µÄ Runnable
ÔËÐжÔÏó¹¹ÔìµÄ£¬Ôòµ÷Óøà Runnable
¶ÔÏóµÄ run
·½·¨£»·ñÔò£¬¸Ã·½·¨²»Ö´ÐÐÈκβÙ×÷²¢·µ»Ø¡£
Thread
µÄ×ÓÀàÓ¦ ......
ΪʲôʹÓÃvolatile±Èͬ²½´ú¼Û¸üµÍ?
ͬ²½µÄ´ú¼Û, Ö÷ÒªÓÉÆ串¸Ç·¶Î§¾ö¶¨, Èç¹û¿ÉÒÔ½µµÍͬ²½µÄ¸²¸Ç·¶Î§, Ôò¿ÉÒÔ´ó·ùÌáÉý³ÌÐòÐÔÄÜ.
¶øvolatileµÄ¸²¸Ç·¶Î§½ö½ö±äÁ¿¼¶±ðµÄ. Òò´ËËüµÄͬ²½´ú¼ÛºÜµÍ.
volatileÔÀíÊÇʲô?
volatileµÄÓïÒå, ÆäʵÊǸæËß´¦ÀíÆ÷, ²»Òª½«ÎÒ·ÅÈ빤×÷ÄÚ´æ, ÇëÖ±½ÓÔÚÖ÷´æ²Ù×÷ÎÒ.(¹¤×÷ÄÚ´æÏê¼ûj ......