java»ñµÃÍøÒ³ÄÚÈÝ
Íøַץȡ Java API ¸ÅÊö
http://code.google.com/intl/zh-CN/appengine/docs/java/urlfetch/usingjavanet.html
App Engine Ó¦ÓóÌÐò¿ÉÒÔÓëÆäËûÓ¦ÓóÌÐò½øÐÐͨÐÅ»òͨ¹ýץȡÍøÖ··ÃÎÊÍøÂçÉϵÄÆäËû×ÊÔ´¡£Ó¦ÓóÌÐò¿ÉÒÔʹÓÃÍøַץȡ·þÎñÀ´·¢³ö HTTP ºÍ HTTPS ÇëÇó²¢½ÓÊÕÏìÓ¦¡£³öÓÚЧÂʺÍÀ©Õ¹ÐÔ¿¼ÂÇ£¬Íøַץȡ·þÎñʹÓà Google µÄÍøÂç»ù´¡½á¹¹¡£
Óà java.net ץȡÍøÖ·
Ìá³öÇëÇó
°²È«Á¬½ÓºÍ HTTPS
ÇëÇó±êÍ·
ÏìÓ¦
ÁªÏµ¹«Ë¾·À»ðǽ֮ºóµÄÖ÷»ú
ÍøַץȡºÍ¿ª·¢·þÎñÆ÷
Åä¶îºÍÏÞÖÆ
Óà java.net ץȡÍøÖ·
Äú¿ÉÒÔʹÓà Java ±ê×¼¿âÖÐµÄ java.net.URLConnection ºÍÏà¹ØÀ࣬ͨ¹ý Java Ó¦ÓóÌÐò´´½¨ HTTP ºÍ HTTPS Á¬½Ó¡£App Engine ʹÓÃÍøַץȡ·þÎñʵÏִ˽ӿڣ»ÄúµÄÓ¦ÓóÌÐòûÓÐÖ±½Ó´´½¨Ì×½Ó×ÖÁ¬½Ó¡£
»ñȡijÍøÖ·µÄÒ³ÃæÄÚÈݵÄÒ»ÖÖ¼òµ¥·½·¨ÊÇ´´½¨ java.net.URL ¶ÔÏó£¬È»ºóµ÷ÓÃÆä openStream() ·½·¨¡£¸Ã·½·¨¿É´¦Àí´´½¨Á¬½ÓµÄÏêÇ飬·¢³ö HTTP GET ÇëÇó£¬È»ºó¼ìË÷ÏìÓ¦Êý¾Ý¡£
import java.net.MalformedURLException;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
// ...
try {
URL url = new URL("http://www.example.com/atom.xml");
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = reader.readLine()) != null) {
// ...
}
reader.close();
} catch (MalformedURLException e) {
// ...
} catch (IOException e) {
// ...
}
¶ÔÓÚ¸ü¸´ÔÓµÄÇëÇó£¬Äú¿ÉÒÔµ÷ÓÃÍøÖ·¶ÔÏóµÄ openConnection() ·½·¨Ò
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
֮ǰ51CTOÔø·¢¹ýһƪÎÄÕ½Ð×ö¡¶OSGiΪʲôÖØÒª£ºÏòÄ£¿é»¯×ªÒƵÄÖ÷¹¥ÊÖ
¡·£¬ÀïÃæ¶ÔÓÚOSGiµÄÓÅÊƽøÐÐÁË·ÖÎö¡£²»¹ý£¬¶ÔÓÚ
¾¿¾¹Ê²Ã´ÊÇOSGi£¬ºÜ¶àÈËÈÔȻֻÓÐÒ»¸öÄ£ºýµÄ¸ÅÄî¡£±¾ÏµÁУ¨ÄãºÃ£¬OSGi
£©´Ó»ù´¡¿ª
ʼ½éÉÜÁËOSGi¡£±¾²¿·Ö½éÉÜOSGiÊÇʲô£¬ÒÔ¼°OSGiÈÝÆ÷µÄһЩÏÖ×´¡££¨×¢£º±¾ÎÄÓ¢ÎÄÔÎÄÓÚ08Äê3Ô·¢²¼ÔÚJavaWorldÍøÕ¾£©
......
ÀàµÄ°ü·ÃÎÊȨÏÞ£º¡¶Java±à³Ì˼Ïë¡·ÖÐÒ»¶Î»°µÄÀ§»ó
ÔÚ¡¶java±à³Ì˼ÏëµÚÈý°æ¡·£¨³Âê»Åô ÈÄÈô骵ÈÒ룩µÄµÚÎåÕÂÒþ²Ø¾ßÌåʵÏÖÖУ¬5.4½ÚµÄ×îºóÒ»¶Î»°ÊÇ£º
“ÕýÈçÇ°ÃæËùÌáµ½µÄ£¬Èç¹ûûÄÜΪÀà·ÃÎÊȨÏÞÖ¸¶¨Ò»¸ö·ÃÎÊÐÞÊηû£¬Ëü¾Í»áȱʡµÃµ½°ü·ÃÎÊȨÏÞ¡£ÕâÒâζןÃÀàµÄ¶ÔÏó¿ÉÒÔÓÉ°üÄÚÈκÎÆäËûÀàÀ´´´½¨£ ......
ÔÚjava³ÌÐòÖÐ,ΪÁËʵÏÖͬ±¾µØϵͳµÄÓ²¼þ¶Ë¿Ú(RS-232±ê×¼´®¿Ú/IEEE1284±ê×¼²¢¿Ú)ͨѶ,Ä¿Ç°ÓÐÁ½¸ö·½·¨,µÚÒ»¸ö¾ÍÊÇÒÔǰ˵¹ýµÄ,ʹÓÃJNI¼¼Êõ×Ô¼ºÐ´Ò»¸öÓëjava³ÌÐòÏà¹ØµÄdll/soÎļþ,Õâ¸öÎļþ¿ÉÒÔÖ±½ÓºÍ±¾µØϵͳͨÐÅ,´Ó¶ø¹ÜÀí±¾µØ»úÆ÷µÄ¶Ë¿Ú,²»¹ýʹÓÃjava³ÌÐò¶À×ÔʵÏÖÒ»¸ö±È½ÏÍêÉƵĶ˿ڹÜÀí½â¾ö·½°¸¶Ô¸öÈ˶øÑÔÊÇÒ»¸ö»¨·Ñ¾Þ´óÇÒ²»Ê ......
package com.hongsoft.test;
import java.io.*;
//¶¨ÖƵÄÀà×°ÈëÆ÷
public class TestCompile extends ClassLoader
{
String _compiler;
String _classpath;
public static void main(String[] args)
{
new TestCompile();
}
public TestCompile()
{
super(ClassLoader.getSystemClassLoader());
//ĬÈϱàÒëÆ ......