用户操作
[即时聊天] [发私信] [加为好友]
cyhgohappyID:cyhgohappy
2690次访问,排名2万外,好友3人,关注者5人。
cyhgohappy的文章
原创 21 篇
翻译 0 篇
转载 10 篇
评论 10 篇
最近评论
hu437:这些Eclipse里面都有

如果NetBeans支持像VS一样的代码提示就好了,最起码希望能有像Eclipse一样的自己设置 代码提示的方法就好了
violy:好帖, 我白痴一点得问,用ftp 上传 图片 是怎么开始找资料的? 如果有api或者在官方网站上有学习资料就好了! 我都找不到,不知如何下手学! 只能在网上找找想你这样的文章! 这样实在是有点浮浅。有高贵一点的渠道获得吗?!
violy:好帖, 我白痴一点得问,用ftp 上传 图片 是怎么开始找资料的? 如果有api或者在官方网站上有学习资料就好了! 我都找不到,不知如何下手学! 只能在网上找找想你这样的文章! 这样实在是有点浮浅。有高贵一点的渠道获得吗?!
cyhgohappy:fu.ftpClient.sendServer("dele 2.txt "); //删除服务器上的文件

在MAIN方法中啊, 其实就是登陆服务器后,执行FTP的删除命令呀
cise2008sdust:连接成功的,到删除那就不响应了,提示
User logged in, proceed.
421
not disconnect
java.net.SocketException: Connection reset
文章分类
收藏
    相册
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 xml配置 spring 中设置定时任务收藏

    新一篇: xPath  | 旧一篇:  linux 下weblogic 基本操作

    1. //Test.java
    2. import java.io.IOException;
    3. public class Test {
    4.         /**
    5.          * @param args
    6.          */
    7.         public static void main(String[] args) {
    8.                 try {
    9. Runtime.getRuntime().exec("sh /fxmweb/test/start.sh");
    10.                 } catch (IOException e) {
    11.                         // TODO Auto-generated catch block
    12.                         e.printStackTrace();
    13.                 }
    14.         }
    15. }
    1. //start.sh
    2. ///fxmweb/good/   删除改目录下三天前的文件
    3.  find /fxmweb/domains/tstDomain/cgServer -type f ! -ctime -3 -exec rm -f {} \;

     

    以下是xml配置 spring 中设置定时任务

      1. <bean id="forceClearService"
      2.         class="nl.base.service.impl.ForceClearServiceImpl">
      3.         <property name="systemCommands">
      4.             <list>
      5.                 <value>
      6.                 sh /mts/properties/start.sh
      7.                 </value>
      8.             </list>
      9.         </property>
      10.     </bean>
      11.     <bean id="forceClearTrigger"
      12.         class="org.springframework.scheduling.quartz.CronTriggerBean">
      13.         <property name="jobDetail">
      14.             <ref bean="forceClearJob" />
      15.         </property>
      16.         <property name="cronExpression">
      17.             <value>0 * * * * ?</value>
      18.         </property>
      19.     </bean>
      20.     <bean id="scheduler"
      21.         class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
      22.         <property name="triggers">
      23.             <list>
      24.                 <ref local="forceClearTrigger" />
      25.             </list>
      26.         </property>
      27.     </bean>
      28.     <bean id="forceClearJob"
      29.         class="org.springframework.scheduling.quartz.JobDetailBean">
      30.         <property name="jobClass">
      31.             <value>nl.base.service.impl.Force</value>
      32.         </property>
      33.         <property name="jobDataAsMap">
      34.             <map>
      35.                 <entry key="forceClear">
      36.                     <ref bean="forceClearService" />
      37.                 </entry>
      38.             </map>
      39.         </property>
      40.     </bean>
    1.  
    2. //Force.java
      1. import org.quartz.JobExecutionContext;
      2. import org.quartz.JobExecutionException;
      3. import org.springframework.scheduling.quartz.QuartzJobBean;
      4. /**
      5.  * 执行系统命令任务类
      6.  * @author cyhgo
      7.  * @since 2008-9-16
      8.  */
      9. public class Force extends QuartzJobBean {
      10.     private ForceClearServiceImpl forceClear;
      11.      protected void executeInternal(JobExecutionContext context)  throws JobExecutionException 
      12.      {
      13.          forceClear.executeComm();
      14.      }
      15.     public ForceClearServiceImpl getForceClear() {
      16.         return forceClear;
      17.     }
      18.     public void setForceClear(ForceClearServiceImpl forceClear) {
      19.         this.forceClear = forceClear;
      20.     }
      21. }
      1. //ForceClearServiceImpl .java
      2. import java.io.IOException;
      3. import java.util.Iterator;
      4. import java.util.List;
      5. /**
      6.  * 执行系统命令任务类
      7.  * @author cyhgo
      8.  * @since 2008-9-16
      9.  */
      10. public class ForceClearServiceImpl{
      11.     /**
      12.      * 系统命令集
      13.      * 清除三天前的所有强平信息
      14.      */
      15.     private List systemCommands;
      16.      public void executeComm()
      17.      {
      18.          if(systemCommands==null) System.out.println("---------");
      19.         for (Iterator it = systemCommands.iterator(); it.hasNext();) {
      20.             String cmd = (String) it.next();
      21.             System.out.println(cmd);
      22.             try {
      23.                 Runtime.getRuntime().exec(cmd);
      24.             } catch (IOException e) {
      25.                 e.printStackTrace();
      26.             }
      27.         }
      28.     }
      29.     public List getSystemCommands() {
      30.         return systemCommands;
      31.     }
      32.     public void setSystemCommands(List systemCommands) {
      33.         this.systemCommands = systemCommands;
      34.     }
      35. }

    发表于 @ 2008年09月19日 10:29:00|评论(loading...)|编辑|收藏

    新一篇: xPath  | 旧一篇:  linux 下weblogic 基本操作

    评论:没有评论。

    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © cyhgohappy