java ¶ÁÈ¡²¢±£´æexcelÖеÄͼƬ
/*
* ±£´æexcelÖеÄͼƬ(ÒÔÎļþÐÎʽ±£´æ£¬»òÕß´æÈëÊý¾Ý¿â)
*
* basePath:Ó¦ÓÃËùÔÚ·¾¶,¸½¼þ´æ·Å·¾¶:
* ²ÎÊý£ºisÊÇÉÏ´«µÄ¸½¼þÎļþÁ÷
*/
public void saveSheetImgByFile(String basePath,InputStream is) throws ParseException {
FileOutputStream os = null;
try {
Workbook wbk = Workbook.getWorkbook(is);
//½¨ÎļþĿ¼
File mkFile = new File(basePath);
if (!mkFile.exists() && !mkFile.isDirectory()) {
mkFile.mkdirs();
}
// Ñ»·ËùÓÐsheet
for (int k = 0; k < wbk.getNumberOfSheets(); k++) {
Sheet sheet = wbk.getSheet(k);
// ¹²ÓжàÉÙÐÐ
int imgNumber = sheet.getNumberOfImages();// »ñµÃsheetËù°üº¬µÄͼƬÊý
// Ñ»·sheetµÄËùÓÐͼƬ
for (int i = 0; i < imgNumber; i++) {
Image image = sheet.getDrawing(i);
byte[] imageD
Ïà¹ØÎĵµ£º
¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷staticµÄ·½· ......
ÏîÄ¿ÖÐÓõ½web service£¬ÓÚÊÇÑо¿Á˶þÌ죬ÏÂÃæ¸ù¾ÝÕâ¶þÌìÓõ½µÄ×ܽáһϣ¬µ±È»×î¶àµÄ»¹ÊǸù¾Ýapache cxf¹ÙÍøÎĵµhttp://cxf.apache.org ¿´Îĵµ£¬µ±È»Ò²²»ÊǶ¼¿´£¬Ö»¿´ÁË×Ô¼ºÐèÒªµÄ¡£
»ù´¡ÖªÊ¶Ñ§Ï°—— Hello Demo
Hello Demo¿ªÊ¼ÁË£¡
µÚÒ»£¬Ð½¨HelloDemo Web ÏîÄ ......
package com.shxy.code;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
i ......
JavaµÚÈý·½library ecosystemÊÇÒ»¸öºÜ¹ãÀ«µÄ·¶³ë¡£²»¾ÃÇ°ÓÐÈË׫ÎÄ£ºÃ¿¸öÏîÄ¿ÖУ¬Äã±ØÐëÖªµÀµÄ11¸öJavaµÚÈý·½Àà¿â¡£
µ¥Ôª²âÊÔ
1.DBUnit
DBunitÊÇÒ»¸ö»ùÓÚjunitÀ©Õ¹µÄÊý¾Ý¿â²âÊÔ¿ò¼Ü¡£ËüÌṩÁË´óÁ¿µÄÀà¶ÔÓëÊý¾Ý¿âÏà¹ØµÄ²Ù×÷½øÐÐÁ˳éÏóºÍ·â×°¡£
2.MOckito
MockitoÊÇÒ»¸öÕë¶ÔJavaµÄmocking¿ò¼Ü¡£Äã¿ÉÒÔʹÓüò½àµÄAPI±àд ......
ÒªÏë½â¾ö“ÔàÊý¾Ý”µÄÎÊÌ⣬×î¼òµ¥µÄ·½·¨¾ÍÊÇʹÓÃsynchronized¹Ø¼ü×ÖÀ´Ê¹run·½·¨Í¬²½£¬´úÂëÈçÏ£º
public synchronized void run()
{
}
´ÓÉÏÃæµÄ´úÂë¿ÉÒÔ¿´³ö£¬Ö»ÒªÔÚvoidºÍpublicÖ®¼ä¼ÓÉÏsynchronized¹Ø¼ü×Ö£¬¾Í¿ÉÒÔʹrun·½·¨Í¬²½£¬Ò²¾ÍÊÇ˵£¬¶ÔÓÚͬһ¸öJavaÀàµÄ¶ÔÏóʵÀý£¬run·½·¨Í¬ ......