惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园_首页
M
MIT News - Artificial intelligence
D
DataBreaches.Net
L
LangChain Blog
宝玉的分享
宝玉的分享
F
Fortinet All Blogs
A
About on SuperTechFans
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
腾讯CDC
Vercel News
Vercel News
雷峰网
雷峰网
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】

博客园 - yiling

Eclipse 12大使用技巧 Hibernate 缓存的使用 Quartz应用 Solaris9下安装Oracle10g详细过程(转) Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream - yiling 使用JOX实现JavaBean和XML之间的转化 java读取property文件 db2常用命令 ant中利用macrodef来定义可重用的task [转]Oracle exp imp sybase备份服务(backup server)不能启动的处理方法 SQL*PLUS环境输入'&字符'的方法 DB2 Catalog hibernate如何设置一对多cascade Hibernate 一些疑点(转的文章,还不错) Ajax客户端与伺服端之间,使用XML作为数据传送 从找实习的过程中发现了自己的弱点 (转)CAD二次开发简介 WID实施过程中的常见问题
java查看文件的创建时间 - yiling - 博客园
yiling · 2009-04-14 · via 博客园 - yiling

不说别的直接上代码。

try{
    Process   p   =   Runtime.getRuntime().exec("cmd /c dir c:\\db2jcc.jar");  
      
             InputStream   is   =   p.getInputStream();  
             BufferedReader   br   =   new   BufferedReader(new   InputStreamReader(is));  
             String   result;  
             String   getTime   =   null;  
             while   ((result   =   br.readLine())   !=   null)   {  
                     if(result.endsWith("db2jcc.jar"))   {  
                             getTime   =   result.substring(0,11);  
                             break;  
                     }  
             }  
             System.out.println("file create time is "+getTime);    
       
  }
  catch (Exception e)
  {
   System.out.println(e.toString());
  }