Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java FTP²Ù×÷

 ¼òµ¥µÄдÁ˸öjava¶ÔftpµÄ²Ù×÷
ÓõÄÊÇcommons-net.jar°ü
FTPProxy.java
public class FTPProxy{
public FTPProxy()
{
super();
ftpClient = new FTPClient();
}
public FTPProxy(FTPBean entity)
{
this();
this.entity = entity;
}
private FTPBean entity;
private FTPClient ftpClient;
public void connection()
{
try
{
ftpClient.connect(entity.getServerIP());
ftpClient.login(entity.getUser(), entity.getPassword());
} catch (SocketException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
}
public void download()
{
FileOutputStream fos = null;
try
{
String remoteFile = entity.getSrcFile();
String remoteFileName = "";
if (0 == remoteFile.lastIndexOf("/"))
{
remoteFileName = remoteFile.substring(remoteFile
.lastIndexOf("/") + 1);
} else if (0 < remoteFile.lastIndexOf("/"))
{
remoteFileName = remoteFile.substring(remoteFile
.lastIndexOf("/") + 1);
String path = remoteFile.substring(0, remoteFile
.lastIndexOf("/"));
ftpClient.changeWorkingDirectory(path);
} else
{
remoteFileName = remoteFile;
}
fos = new FileOutputStream(entity.getTargetFile());
ftpClient.setBufferSize(1024 * 8);
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
ftpClient.retrieveFile(remoteFileName, fos);
} catch (IOException e)
{
e.printStackTrace();
} finally
{
try
{
fos.close();
ftpClient.disconnect();
} catch (IOException e)
{
e.printStackTrace();
}
}
}
public void upload()
{
FileInputStream fis = null;
try
{
File srcFile = new File(entity.getSrcFile());
fis = new FileInputStream(srcFile);
ftpClient.setBufferSize(1024 * 8);
ftpClient.setControlEncoding("GBK");
String ftpPath = entity.getFtpPath();
if(null!=ftpPath&&!"".equals(ftpPath))
{
ftpClient.makeDirectory(ftpPath);
ftpClient.changeWo


Ïà¹ØÎĵµ£º

¡¾×ª¡¿java ´Ê»ã±íËÙ²éÊÖ²á

java ´Ê»ã±íËÙ²éÊÖ²á
http://bbs.54master.com/91318,1,109
Abstract class ³éÏóÀà:³éÏóÀàÊDz»ÔÊÐíʵÀý»¯µÄÀ࣬Òò´ËÒ»°ãËüÐèÒª±»½øÐÐÀ©Õ¹¼Ì³Ð¡£
Abstract method ³éÏó·½·¨:³éÏó·½·¨¼´²»°üº¬Èκι¦ÄÜ´úÂëµÄ·½·¨¡£
Access modifier ·ÃÎÊ¿ØÖÆÐÞÊηû:·ÃÎÊ¿ØÖÆÐÞÊηûÓÃÀ´ÐÞÊÎJavaÖÐÀà¡¢ÒÔ¼°ÀàµÄ·½·¨ºÍ±äÁ¿µÄ·ÃÎÊ¿ØÖÆÊôÐÔ¡£ ......

jsp(JAVA)α¾²Ì¬µÄ¾ßÌåÉèÖùý³Ì

Ò»£ºµ½http://tuckey.org/urlrewrite/  ÏÂÔØurlrewrite¼Ü°ü£¨ÍƼö2.6.0£©
¡¡¡¡¶þ£º½âѹËùÏÂÔØµÄÎļþ,°Ñurlrewrite-2.6.0.jar¸´ÖƵ½ÏîÄ¿µÄWebRoot/WEB-INF/lib/Ŀ¼ÏÂ
¡¡¡¡Èý£º°Ñurlrewrite.xml¸´ÖƵ½ÏîÄ¿µÄWebRoot/WEB-INF/Ŀ¼ÏÂ
¡¡¡¡ËÄ£ºÔÚweb.xmlÎļþÖмÓÈëÒÔÏÂ
¡¡¡¡<filter>
¡¡¡¡<filter-name>Ur ......

java Óʼþ·þÎñÆ÷Ö®james°²×°ÅäÖÃ


James Óʼþ·þÎñÆ÷µÄ°²×°ºÍÅäÖÃ
»·¾³:
Óʼþ·þÎñÆ÷:
²Ù×÷ϵͳ:REDHAT LINUX AS 4
IP:192.168.1.108
×ÓÍøÑÚÂë:255.255.0
Íø¹Ø:192.168.1.1
DNS:192.168.1.2
¿Í»§¶Ë:
²Ù×÷ϵͳ:windows 2003
IP :192.168.1.2
×ÓÍøÑÚÂë:255.255.255.0
Íø¹Ø:192.168.1.1
DNS:192.168.1.2
¼òµ¥½éÉÜÒ»ÏÂÓʼþ·þÎñÆ÷µÄÅäÖû·¾³
ÒѾ­° ......

JavaÏß³ÌÖ®yeild()Àí½â

²âÊÔÖз¢ÏÖÈç¹û¼¸¸ö´¦ÓÚ¿ÉÔËÐÐ״̬µÄÏ̵߳ÄÓÅÏȼ¶¶¼Ð¡ÓÚ»òÕßµÈÓÚ6ʱ£¬yield()·½·¨¿É½«ÔËÐлú»áÈøøÓÅÏȼ¶Îª6ºÍÓÅÏȼ¶Îª5µÄÏ̡߳£
¶øÈç¹ûµ÷ÓÃÁËyield()·½·¨µÄÏ̵߳ÄÓÅÏȼ¶´óÓÚ»òµÈÓÚ7ʱ£¬Ôò²»»á½«ÔËÐлú»áÈøøÆäËûÏ̡߳£ ......

myeclipse×¢²á»ú,javaдµÄÊÊÓÃÓÚËùÓа汾


import java.io.*;
public class Test {
    public static String convert(String s) {
        if (s == null || s.length() == 0)
            return s;
        ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ