The Artima Developer Community
Sponsored Link

Java Answers Forum
Handling files in java

1 reply on 1 page. Most recent reply: Mar 26, 2002 12:39 PM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Hiran

Posts: 41
Nickname: jclu
Registered: Mar, 2002

Handling files in java Posted: Mar 26, 2002 11:09 AM
Reply to this message Reply
Advertisement
Is there any way I can retreive a file's information (such as size of the file, date created, date modified)? I can't seem to find any class that allows me to do these things. I'm actually interested in getting the size of a file more specifically, but I might need to get other information (such as date created) in the future. Any help will be greatly appreciated.
Hiran


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Handling files in java Posted: Mar 26, 2002 12:39 PM
Reply to this message Reply
Java doesn't give you all pieces of information about files. However, you can get the file size and last modifed date. Please refer to java.io.File class. length() method gives you size and lastModified() method gives you last modified date.

Thanks
Kishori

Flat View: This topic has 1 reply on 1 page
Topic: Java Object References Previous Topic   Next Topic Topic: matt - 4 your eyes only

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use